[Gtk-sharp-list] simple test case for threading bug
Jamin Philip Gray
jamin@pubcrawler.org
Wed, 5 Nov 2003 12:01:09 -0600 (CST)
Beautiful. I got it working with the Timeout. Thanks for your
quick replies, Mike and Leo.
On Tue, 4 Nov 2003, Leo Spalteholz wrote:
> 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
>
--
name: Jamin Philip Gray
email: jamin@pubcrawler.org
icq: 1361499
aim: jamingray47
yahoo: jamin47
web: http://pubcrawler.org
"[A wasp] was sucking jam on my plate and I cut him in half.
He paid no attention, merely went on with his meal, while a
tiny stream of jam trickled out of his severed esophogus.
Only when he tried to fly away did he grasp the dreadful
thing that had happened to him."
--George Orwell