From: Kevin A. <al...@se...> - 2006-09-20 23:52:58
|
On Sep 20, 2006, at 4:09 PM, kc1...@ya... wrote: > If that's the case, may be I can accomplish what I > need to do by getting the gainFocus event of the main > window. > > I did try that before but the problem is that if I > capture the event by doing an on_mybgWindow_gainFocus, > a lot of things no long works (like list objects don't > scroll open anymore). I am suspecting that when I > capture the gainFocus event and do some processing, I > need to send the same event back to the system > somehow. In other words, I need to "sandwich" my code > into the event queue - rather then "robbing" the > event. (That's what needs to be done in other GUI > packages I used to use). > > How do I do that in PythonCard? > > Thanks, In general, when you want to do something not obviously supported in PythonCard you probably have to fall back on wxPython events. At that point it is time to look at the wxPython demo and wxWindows reference help and possibly post to the wxPython-users mailing list. It is also helpful to provide a description of what you're trying to accomplish, so nobody makes assumptions about what you need. I'm still not sure based on what you've posted what exactly you want to do. Are you needing to update a menu or menu item when the user clicks on a menu? Whenever you intercept an event like gainFocus, you are probably going to need to call event.skip() so that the underlying event system gets a chance to process the event as well. Also while your event handler is processing no other processing is going on, so unless you make explicit calls to force refreshes of controls don't expect to see any updates if you make changes. Finally, due to the way the underlying systems work, beware of menu bar trickery if you want it to work cross-platform. ka |