>
> Now, the console shows, in order, "Before Run", "Before Sleep", "After
> Sleep". The MainWindow, despite being run in a Gtk.Application invocation,
> does not show until after the function returns. In other words, attempting
> to show a splash screen and doing some heavy work there would result in the
> same problem as the one I'm having. Thanks for your reply, but it is
> unfortunately no solution.
>

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.
_______________________________________________
Gtk-sharp-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to