On Nov 3, 2005, at 8:39 , Heikki Toivonen wrote:

(removing content not part of this discussion, and cleaning CC list as
we are all on dev)

John Anderson wrote:
Ted Leung wrote:

Did you try it with just the Yield (e.g. wx.GetApp().Yield())?. I think
that may be all that's necessary to run the Idle loop.

Yield() alone is not enough. I don't know the exact details but Katie,
Grant and Donn have been working out the kinks and so far the best
workaround is the processNextIdle() below.

    def processNextIdle():
        wx.GetApp().Yield()
        ev = wx.IdleEvent()
        wx.GetApp().ProcessEvent(ev)
        wx.GetApp().Yield()

Looking at the profiles generated by this function, it seems the Yield () calls trigger painting the UI (if needed). This is consistent with the documented behaviour:

Process all currently pending events right now, instead of waiting until return to the event loop.

(From <http://www.wxpython.org/docs/api/wx.PyApp-class.html#Yield>)

Even in cases where there's no painting to be done (i.e. events to be processed), a Yield() does not trigger an Idle event. In fact, the documented behaviour of wx.App.ProcessIdle() is:

Called from the MainLoop when the application becomes idle (there are no pending events) and sends a wx.IdleEvent to all interested parties

So, since Yield() essentially bypasses the main event loop, it doesn't lead to posting of idle events.

Regardless, we should probably move the above function to QAUITestLib.py.

--Grant

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to