[pygtk] Gui Locks up after button clicked. (extensive process started)

Frédéric frederic.mantegazza at gbiloba.org
Wed Jan 28 17:06:44 WST 2009


Le 27/1/2009, "Riley Porter" <rileyporter at gmail.com> a écrit:

>I know I am missing something but say I have a pygtk interface all designed
>and when I click start on a button it triggers a process what takes about 10
>mins to complete.  During this time the button stays down and I cannot do
>anything else on the gui.  Shortly after the GUI becomes "un-usable" and
>locks up.  What am I doing wrong here?  Is there a way around this?  I am
>assuming you need to use a type of thread or somthing however I do not know?

As said, you can launch a thread to do your computation. Another
solution, without using thread, is to periodically call:

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

in you computation loop.



--
   Frédéric


More information about the pygtk mailing list