Re: Long running nautilus extensions



On Fri, 2005-06-17 at 09:15 +0200, Mikkel Kamstrup Erlandsen wrote:
> Yes. As Nickolay also points out you have to dig into the threading
> documentation on www.pygtk.org.
> 
> You would probably want to pass control back to Nautilus as soon as
> possible and then finish your threads of with a callback, instead of
> waiting for them.
> 
> Note that when using threads it is also important to do the following
> instead of just entering gtk.main () as normally:
> 
> gtk.threads_init()
> gtk.threads_enter ()
> gtk.main ()
> gtk.threads_leave ()
> 
> - and then each time your threads use gtk put gtk.threads_enter () and
> gtk.threads_leave () around that block of code. Well you'll find more
> about that on www.pygtk.org.

Unfortuntely nautilus isn't really threadsafe in its use of Gtk+, so you
can't in general do any UI calls on any thread but the main thread.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an oversexed vegetarian matador with a robot buddy named Sparky. She's a 
time-travelling goth detective with an evil twin sister. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]