On Sun, Apr 26, 2009 at 3:29 PM, Piotr Budny <[email protected]> wrote: > Hello, > for all, who don't want to download external code, here's the simplest one. > It still randomly SIGSEGVs. ... > Sig.Changed += new ChangedEventHandler(this.OnChanged); .. > protected void OnChanged(string s) > { > Random r = new Random(); > l.Text = String.Format("blah blah: {0}, {1}", > r.Next(), s); > l.ModifyBg (Gtk.StateType.Normal, new Gdk.Color > ((byte)r.Next(), > (byte)r.Next(),(byte) r.Next()));
GTK+ isn't threadsafe; you can't safely touch GTK objects from other threads. There are a few ways to handle timers and calls from other threads: Gtk.Application.Invoke GLib.Timeout.Add GLib.Idle.Add See http://mono-project.com/Responsive_Applications for more info. -- Michael Hutchinson http://mjhutchinson.com _______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
