[wxPython] inserting events in the queue?

I added a closeField event to PythonCard that is only fired if a field is
actually modified while it has focus. I'm using DiscardEdits() and
IsModified() for this.

Anyway, I can post the event using wxPostEvent, but the problem is that puts
the event at the end of the queue which will be after the set focus event.
Worse, if the user clicked on a button, there might be a mouse down or other
events that depend on whether the field was modified.

So, is there a way to insert the event immediately after the kill focus
event even though other events are already in the queue? My only other
option seems like changing the event type of the kill focus event to the
close event.

ka

So, is there a way to insert the event immediately after the kill focus
event even though other events are already in the queue? My only other
option seems like changing the event type of the kill focus event to the
close event.

Assuming that by kill focus event you mean the event that you are currently
handling, then no you can do it immediately after. But you can cause it to
be processed immediately (befoe the kill focus handler returns) by doing
this:

    evtHandler.GetEventHandler().ProcessEvent(event)

instead of this:

    wxPostEvent(evtHandler, event)

ยทยทยท

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!