[Gtk-sharp-list] GUI hangs

Calvin Gaisford cgaisford@novell.com
Thu, 20 May 2004 08:45:03 -0600


Tim,

All of your calls to Gtk# have to be from your main thread.  I believe
even the timer callbacks will not be on your main thread.  There are a
couple of ways around this but I personally have found that ThreadNotify
works the best.

Another option with Gtk# is to use Gtk.Timeout.  Basically it will call
back your main thread in the specified number of seconds.  Very handy
for updating UI at a specified interval.

-Calvin


On Thu, 2004-05-20 at 16:24 +0200, Tim Rädisch wrote:
> Hi!
> 
> I've a problem using Gtk# and a timer or thread. I need it for something like 
> a counter. Every second a value have to be incremented. There are no compile 
> errors, and it seems to run.
> 
> But after a while (sometimes seconds, sometimes minutes) the GUI "hangs". 
> Everything else works fine. The internal values are changed correct, even a 
> Debug.WriteLine(...) before and after jackpotLabel.Text="..." is prompted 
> correct.
> 
> Does anyone know where the problem is? 
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list