Matteo Bertozzi wrote:
> I don't have understand the Responsive Application "Lesson" at
> http://www.mono-project.com/Responsive_Applications
> Why OnButtonClick() Code Freeze the GUI?
> and how i could correct it?
The problem is here:
> Gtk.Application.Invoke (delegate {
> Thread.Sleep(1800 + 3600);
> button.Label = "End Hard Work";
> });
The code in the event handler is already running in the GTK thread.
Your code attempts to pass the code to the GTK thread from within the
GTK thread.
Gtk.Application.Invoke is only used within threads other than the GTK
thread (because GTK# is not 'threadsafe'). So, if you had a thread
called mythread, once that thread was started you would use
Gtk.Application.Invoke to access GTK objects safely.
_______________________________________________
Gtk-sharp-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list