[Gtk-sharp-list] GIo or another mechanism of signaling Application.Run

Michael Meeks michael@ximian.com
12 Aug 2002 17:22:51 +0100

Hi Miguel,

On Mon, 2002-08-12 at 15:12, Miguel de Icaza wrote:
>     The issue I am running into is that I need to signal my Gtk thread
> that it should repaint the images that have just been loaded, or whose
> quality has been improved.

	Use g_idle_add; that has the benefits of:

	a) being thread safe
	b) having a wake_up fd in the glib mainloop already being polled
	   so it will wake up any main thread code in the mainloop/

>     So what I need is that my worker thread (who can not do any Gtk
> calls) wake up the main thread and let the main thread pick up the
> results.    My plan is to use a pipe, and use the pipe to "wakeup" a
> callback on the Gtk thread:

	Best not to re-invent what's already there ;-)



 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot