manual event loop

Hi,
in version 2.4, the simple loop
while 1:
    while app.Pending():
        app.Dispatch()

was a useful replacement for app.MainLoop(). For version 2.5,
the loop
while 1:
    while app.Pending():
        app.Dispatch()

···

#
    sleep(0.001)
    #
    app.ProcessIdle()

(taken from wxPythonSrc-2.5.1.5/wxPython/demo/demoMainLoop.py)
results in a blank GUI with no interaction.
Does anybody know how to replace the new MainLoop() in Python?

-- Mike

P.S. The mainloop now uses the C++ class wxEventLoop, but I didn't see that wrapped for
Python.

Michael Hohn wrote:

Hi,
in version 2.4, the simple loop
while 1:
   while app.Pending():
       app.Dispatch()

was a useful replacement for app.MainLoop(). For version 2.5,
the loop
while 1:
   while app.Pending():
       app.Dispatch()
   #
   sleep(0.001)
   #
   app.ProcessIdle()

(taken from wxPythonSrc-2.5.1.5/wxPython/demo/demoMainLoop.py)
results in a blank GUI with no interaction.

Obviously it's been a while since I ran demoMainLoop... It did work with an earlier 2.5 build though. I'll try to figure out what is going on with it.

Does anybody know how to replace the new MainLoop() in Python?

-- Mike

P.S. The mainloop now uses the C++ class wxEventLoop, but I didn't see that wrapped for
Python.

Not yet.

···

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