Re: GTK app with scrolled window crashing trying to show a widget inside



On 12/30/2011 06:08 PM, Michael Torrie wrote:
On 12/30/2011 05:52 AM, David NeÄas wrote:
On Fri, Dec 30, 2011 at 01:28:32PM +0100, Moritz Renftle wrote:
i want to make one of those widgets visible from
another thread

Use glib.idle_add() in that other thread to subsequently execute the
actual Gtk+ code in the thread running the Gtk+ main loop.

http://unpythonic.blogspot.com/2007/08/using-threads-in-pygtk.html

It used to be that threading issues came up every week on the list.  As
David says, the recommended way is using idle_add.  However if you use
gdk locks appropriately, on Linux you can call Gtk calls directly from
threaded code.

http://www.pardon-sleeuwaegen.be/antoon/python/page0.html

But since this won't work so well on Windows, the idle_add() technique
is recommended as it is most safe and most portable.

You may check out http://www.iki.fi/tml/fosdem-2006.pdf about gtk-win32
and threads.

-- 
Emmanuel Thomas-Maurin <manutm007 gmail com>



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