[Gtk-sharp-list] simple test case for threading bug

Leo Spalteholz leo@thewoodpecker.ca
Tue, 4 Nov 2003 10:20:05 -0800


On November 4, 2003 09:01 pm, Jamin Philip Gray wrote:
> In developing a multithreaded Gtk# application I've run across a problem
> where the Gnome.Canvas stops updating. It's somewhat random as to when
> it happens, but I was able to create a relatively simple test case that
> reproduces the problem nearly every time I run it on my machine.  You
> can tweak the values of loopsize to increase the likelihood the freeze
> will occur.  I'm sure there is something obvious I'm missing, so if
> someone could take a look at the attached .cs and Makefile and let me
> know what you think, I'd appreciate it.  Nevermind that this is a silly
> app; it's just a simple test case to illustrate the issue I'm having.

As Mike said, you can't update the GUI from a different thread.  Use a 
Gtk.Timeout instead to call your MoveSquare method every x seconds.

~leo