1. RE: setHandler bug
- Posted by Judith <camping at txcyber.com> Jun 16, 2002
- 431 views
It's my understanding that when using setHandler that your procedure params change to integer self, integer event, sequence params, or whatever variable names you choose, and that in params you find event, wParam and lParam so that your routine would look something like this: procedure on_event( integer self, integer event, sequence params) if params[1] = WM_NOTIFY then ?1 end if end procedure setHandler(Win, w32HEvent, routine_id("on_event")) tone.skoda at gmx.net wrote: > Hi, > It looks like event parameter in on_event () is allways 3 when using > setHandler(). > > Here's a little demo: > > ---------- > -- setHadler bug.exw > > without warning > include win32lib.ew > > constant > Win = create( Window, "setHandler bug", 0, Default, Default, 640, 480, > 0 ), > TV = create( TreeView, > "Treeview", > Win, > 0, > 0, > 250, --CW_USEDEFAULT, > 300, --CW_USEDEFAULT, > or_all({TVS_HASLINES, TVS_LINESATROOT, TVS_HASBUTTONS, > TVS_SHOWSELALWAYS, > TVS_NONEVENHEIGHT, > TVS_EDITLABELS, > TVS_INFOTIP > })) > > > procedure on_event (atom event, object wParam, object lParam) > if event = WM_NOTIFY then > ?1 > end if > end procedure > > -------- ****************************** > -------- ** UNCOMMENT LINE BELOW > -------- ** WITH onEvent > -------- ** AND COMMENT OUT setHandler() > -------- ** TO SEE THE DIFFERENCE > -------- ****************************** > -- onEvent [Win] = routine_id ("on_event") > setHandler (Win, w32HEvent, routine_id ("on_event")) > > WinMain (Win, Normal) > > ----- Original Message ----- > From: "Derek Parnell" <ddparnell at bigpond.com> > To: "EUforum" <EUforum at topica.com> > Sent: Sunday, June 16, 2002 7:53 AM > Subject: Re: setHandler bug > > > > > > Hi Tone, > > I couldn't reproduce the effect you described. When I tried, I got > WM_NOTIFY > > events using both methods. > > > > Is there anything else you can give me to try and find the problem? > > > > ----- Original Message ----- > > From: <tone.skoda at gmx.net> > > To: "EUforum" <EUforum at topica.com> > > Sent: Sunday, June 16, 2002 10:10 AM > > Subject: setHandler bug > > > > > > > > > > If I use > > > setHandler (tree_parent, w32HEvent, routine_id ("tree_parent_event")) > > > then tree_parent_event() doesn't receive any WM_NOTIFY messages. > > > > > > If I use > > > onEvent [tree_parent] = routine_id ("tree_parent_event") > > > it does receive WM_NOTIFY. > > > > > > > > >