Two questions, one out of curiousity and one which I
might actually need to know:
I've followed Robin's suggestion, and written my own OnOK
to do some extra work and call event.Skip() to get the
default behaviour (including hiding the window) as well.
The odd thing is that calling IsShown() during this work
reports true regardless of whether I call event.Skip() first
or last. I've looked through the wxWindows source a bit,
and it looks like event.Skip() doesn't proceed with the rest
of the event handling, but just sets a flag. I suspect
this simply tells wxWindows to continue looking through
the event tables AFTER my handler returns.
1. Is this understanding of event.Skip() correct?
(I'd rather not try to puzzle out the rest of the
wxEvtHandler source if I can just get a quick
confirmation of this point.)
2. If I really do want to defer some processing until after
the dialog is no longer shown, how would I do this?
If I have my OnOK post a custom event, which wouldn't
be processed until the application returns to the message
loop, will that do the trick?
David
···
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at http://webmail.netscape.com/
The odd thing is that calling IsShown() during this work
reports true regardless of whether I call event.Skip() first
or last. I've looked through the wxWindows source a bit,
and it looks like event.Skip() doesn't proceed with the rest
of the event handling, but just sets a flag. I suspect
this simply tells wxWindows to continue looking through
the event tables AFTER my handler returns.
1. Is this understanding of event.Skip() correct?
Yes.
(I'd rather not try to puzzle out the rest of the
wxEvtHandler source if I can just get a quick
confirmation of this point.)
2. If I really do want to defer some processing until after
the dialog is no longer shown, how would I do this?
If I have my OnOK post a custom event, which wouldn't
be processed until the application returns to the message
loop, will that do the trick?
Do it in idle time, which will happen after all current or pending events
are processed. Typically this is done by setting a flag in the event
handler and then calling event.Skip and returning. Then you'll need an
EVT_IDLE handler somewhere that checks this flag and then does whatever
post-processing you are needing and then resets the flag.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!