[wxPython] Sending events to wxApp instance from different thread

Okay, I see. So it’s normal behavior. However, I can easily work

around by creating an empty frame which is not visible.

Thanks & keep on working, wxPython programming is really very productive!!!

Lars

“Robin Dunn” robin@alldunn.com

Sent by: wxpython-users-admin@lists.sourceforge.net
12/01/01 17:58

Please respond to wxpython-users

···
    To:        <wxpython-users@lists.sourceforge.net>

    cc:        

    Subject:        Re: [wxPython] Sending events to wxApp instance from different thread

I did some more research – interestingly the problem occurs only

if I do not create an initial first window, but ask the app object

to create it as a response to the event. Adding an dummy frame to

the app in its init function avoids the problem.

Is there any fundamental reason for this that I do not understand?

Events from other threads get processed in IDLE time in the GUI thread. Idle time happens right after the event queue becomes empty. When you call wxPostEvent or wxWakeUpIdle then it sends a dummy messagfe to the main top level window in order to ensure that the event queue can “become empty.” If there is no window then you have to wait for some other event to be delivered, before the idle handler will be started.

Robin Dunn

Software Craftsman

robin@AllDunn.com Java give you jitters?

http://wxPython.org Relax with wxPython!


wxPython-users mailing list

wxPython-users@lists.sourceforge.net

http://lists.sourceforge.net/lists/listinfo/wxpython-users