|
Re: Threads and applets (gnome.applet): msg#00118gnome.gtk+.python
On Mon, 2005-02-21 at 10:37 +1100, Brad Tonkes wrote: >On Fri, 18 Feb 2005, Johan Dahlin wrote: > >> Brad Tonkes wrote: >> >Hi, >> > >> >I've recently encountered some problems with threads in a (python) gnome >> >panel applet. My problem is that any spawned threads don't seem to get >> > >> > >> Don't use threads together with the panel applet code. >> Neither ORBit, bonobo, nor orbit-python is thread safe. And the pygtk >> code is less than perfect when it comes to threads. >> I'd really advise you to use something other than threads. > >Since I have am interfacing with a threaded, third party networking >library I have only two options: (1) use threading, (2) fork a process >and communicate using pipes or shared mem. Solution (2) is ugly and >potentially less portable than solution (1). Solution (1) is >straightforward: I am careful to only perform gtk/gnome operations >within the mainloop thread, and the gtk-only version works perfectly, as >did my gnome panel applet in the 1.x days and as of a few weeks ago in >2.x (x >= 2). Moreover, it is working just fine (for someone else) on >Fedora core 2 (pygtk 2.2.0, gnome-python 2.0.0). Just filed http://bugzilla.gnome.org/show_bug.cgi?id=168057 I think it's a miracle it worked in gnome-python 2.0.0. One more thing. Due to a bug in libpanel-applet (http://bugzilla.gnome.org/show_bug.cgi?id=150122), you can't subclass Applet. Or, you can create a python subclass, but not a GObject subclass. So I suggest you: 1) don't call gobject.type_register(), 2) in __init__, call the parent constructor as gnome.applet.Applet.__init__(self) Regards. -- Gustavo J. A. M. Carneiro <gjc@xxxxxxxxxxxxx> <gustavo@xxxxxxxxxxxxxxxxxxxxx> The universe is always one step beyond logic.
pygtk mailing list pygtk@xxxxxxxxxx http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Forbid focusing of TreeView columns: 00118, Franck Pommereau |
|---|---|
| Next by Date: | Re: error loading gtksourceview: 00118, Stéphan Kochen |
| Previous by Thread: | Re: Threads and applets (gnome.applet)i: 00118, Brad Tonkes |
| Next by Thread: | gtksourceview: 00118, Jose de Paula Eufrasio Junior |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |