wndproc is not out of favor for windows controls, but for GTK it is. Each control sets a callback for EACH signal so we dispatch them that way.
The msg's aren'tr being passed back yet because no one has coded them yet. A few of them are already coded, like keydown.
I'm not sure about converting everything to use wndproc. How does wndproc handle it then? Does it simply do a dispatch? I haven't looked at Delphi's method of handling this, so I'm not awarer of it.
Shane
>> "Samuel Liddicott" 08/16 11:49 AM >>>
Are wndprocs are completely out of favour in lazarus?
I see the gtkcallback uses dispatch directly; also it seems many of the callbacks do not pass back the result of the dispatched message to gtk.
Is this right?
I think the callbacks should not call Dispatch, but WndProc.
It is TControl.WndProc (first object where wndproc is declared (virtual, not override) that calls dispatch for all messages that have made it thus far (usually unhandled messages, not always - I'm not sure if dispatch will pass on messages that have been handled).
WndProc acts like a pre-dispatch interceptor, and DefaultHandler acts like a post-dispatch interceptor.
In delphi the DefaultHandler calls the window-controls own default wndproc.
Broadcasts are sent to the wndproc of controls - also VERY useful for messages unknown at design time - RegisterWindowMessage et al.
So; I'm suggesting that instead of calling Dispatch, gtkcallback calls the wndproc. (Maybe if it is a TControl descendand - otherwise (for csCanvas etc call dispatch)?
Is this OK? If so I will make the changes to include in the diff's I will send up.
Sam
_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus