[pygtk] call set_label() periodically
Pietro Battiston
toobaz at email.it
Wed Aug 26 21:44:50 WST 2009
Il giorno mer, 26/08/2009 alle 05.19 +0430, saeed ha scritto:
> When you use GTK, that's very unlikely that you need manual multithreading!
... and if it happens (usually to accomplish operations which take much
time to execute and would freeze the GUI), it is much easier to keep the
worker thread separate from the gtk functions (by using a buffer -
usually, just a list, a dictionary or even a simple int - that the
worker thread populates and the main thread just periodically looks at).
... and if you _really_ need a (non main) thread to play with gtk, don't
forget to use threads_enter and thread_leave
Pietro
>
> On 8/25/09, Jeffrey Barish <jeff_barish a earthlink.net> wrote:
> > Sebastian Henneberg wrote:
> >
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> Hi everybody,
> >>
> >> I've a strange problem with set_label on gtk.Buttons and gtk.Labels.
> >> I've a thread that gets access to the widget and should call set_label()
> >> method of the widget every second, to update the displayed data. But
> >> nothing happens...
> >>
> >> After initializing the thread, the widget's label doesn't change no more.
> >>
> >> Any suggestions where the failure could be?
> >
> > Use gobject.timeout_add instead of multithreading.
> > --
> > Jeffrey Barish
> >
> >
> > _______________________________________________
> > pygtk mailing list pygtk a daa.com.au
> > http://www.daa.com.au/mailman/listinfo/pygtk
> > Read the PyGTK FAQ: http://faq.pygtk.org/
> >
> _______________________________________________
> pygtk mailing list pygtk a daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
More information about the pygtk
mailing list