Re: wxEuphoria no event triggered
- Posted by Matt Lewis <matthewwalkerlewis at g?ai?.com> Jan 25, 2008
- 535 views
Greg Haberek wrote: > > jacques deschĂȘnes wrote: > > > > That wright. It's what I did at first, but it was apparently not working. > > The > > error was in the event handler itself. I was calling end_dialog() with the > > this > > parameter which is not the dialog but the button. > > So the dialog was nerver closing. From there I wrongly concluded that event > > handler was not called. > > I should had trace my code before going to wrong conclusion. > > > > thanks both of you for your answer. > > Ah yes, the "this isn't that" paradigm. wxEuphoria has lead me down that road > many, many times. I'm used to the Win32Lib mindset where each control gets > its own events and "pSelf" is what had assigned in setHandler(). Yeah, the event handling is a little different. It should be whatever was the first parameter in the call to set_event_handler. So generally, you can have a control handle its own events, or allow its parent to do that. It all makes more sense in an OO environment (which wxWidgets is). Also, I've tried to make as many things as possible work similarly to win32lib, but of course, not every peg manages to fit that round hole, which can lead to some confusion. But I think that overall, it's better to be similar, because it generally leads to a less steep learning curve. Matt