[MonoDevelop] How to Make Dialog which Disappears after 3 Seconds?

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Apr 3 13:57:00 EDT 2010


On Fri, Apr 2, 2010 at 1:37 PM, Buttink <Buttink at gmail.com> wrote:
>
> I dont think GTK# is threadsafe. So depending on how you use the timer, it
> will probably crash GTK#. Im pretty sure this is the exact same thing that
> happends with winforms and WPF apps if you dont use Control.Invoke. Try
> looking at this  http://www.albahari.com/threading/part3.aspx#_ControlInvoke
> http://www.albahari.com/threading/part3.aspx#_ControlInvoke . Iv never
> actually tried this but its worth a shoot.

Control.Invoke does not exist in GTK#. Use Application.Invoke:

http://www.mono-project.com/Responsive_Applications#Gtk.Application.Invoke

Also, in this particular case a Glib timeout would make more sense
than a timer, since it runs on the GTK mainloop:

http://www.mono-project.com/Responsive_Applications#Timeouts

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Monodevelop-list mailing list