[Gtk-sharp-list] How to implement a splash screen?

DarkPhoenix alexschrod at gmail.com
Sat Apr 4 09:15:23 EDT 2009



Jiří Zárevúcky wrote:
> 
> I think it should work like this:
> 
>   var window = new Gtk.Window ();
>   window.Show ();
> 
>   Application.Invoke (DoSomeHeavyWorkHere);
> 
>   Application.Run ();
> 
> Alternatively, you can use a simple thread:
> 
>   using System.Threading;
> 
>   ...
> 
>   var window = new Gtk.Window ();
>   window.Show ();
> 
>   var thread = new Thread (delegate { DoSomeHeavyWorkHere () });
>   thread.Start ();
> 
>   Application.Run ();
> 
> 
> Of course, as Gtk isn't thread-safe, you'll have to dispatch any GUI
> updates from the thread via Application.Invoke.
> 

Your first solution was as ineffective as all the others, but your second
solution worked like a charm. So, in case somebody is looking for the way to
do this in the future, using a System.Threading.Thread to do your background
work while updating the GUI through Application.Invoke() calls is the way to
go.
-- 
View this message in context: http://www.nabble.com/How-to-implement-a-splash-screen--tp22757836p22883260.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.



More information about the Gtk-sharp-list mailing list