[pygtk] Finishing all UI events before blocking

Adam Olsen arolsen at gmail.com
Thu Jul 13 08:03:09 WST 2006


I'm looking for something similar to wx.Yield() in wxPython.

I've looked around a bit, and have come up with this function:

def finish():
    """
        Waits for current pending gtk events to finish
    """

    while gtk.gdk.events_pending():
        gtk.main_iteration()

but it doesn't work.  If I try to set the text of a label while in a loop
that takes a long time, this function doesn't do anything.  The text in the
label only ends up changing after the entire loop is done.

What am I doing wrong?

Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060712/952d127f/at=
tachment.htm


More information about the pygtk mailing list