[Gtk-sharp-list] [NewBie] Gtk.Main Thread Notification

Antonio Martínez Álvarez amartinez@atc.ugr.es
Mon, 15 Mar 2004 12:52:39 +0100

Alessandro Lendaro wrote:
> Hi, I have a Thread running the Gtk.Main (Application.Run()) and when a 
> button is pressed another thread is
> started which does some work on a database with events firing when some 
> output messages have to be shown in a
> TextView widget.
> The thing works magnifically, but at the end of the DB Worker thread I 
> want a MessageDialog to be shown
> if there have been errors in the operation.
> The things is, events run in the DB Worker thread, and when the 
> MessageDialog.Run() method is executed,
> I get an error because the Gtk.Main() loop is running in another thread.
> So I think I must notify to the other thread that it must execute the 
> Message.Run() ...
> after a little search I found that the ThreadNotify class can be used in 
> this case, but a System.DLLNotFound Exception is thrown when I 
> istantiate the ThreadNotify Class ... referred to libc.so.6...
> Gtk# 0.17 on Windows 2000 / .NET Framework 1.0

I have had these problems too. I have just used GLib.Idle class to make 
the main thread do the Gtk# stuff.

It works for me in both Linux (mono and Gtk# annon_cvs) and Windows 
(mono 0.30 Gtk# 0.15).

Antonio Martínez.