[Gtk-sharp-list] Make Run() of a Dialog return imediately

Cody Russell bratsche at gnome.org
Thu May 1 12:05:11 EDT 2008

On Wed, 2008-04-30 at 16:13 +0200, Mathias Tausig wrote:
> What I would like to do is to display some sort of Dialog on the
> screen
> the displays a status message (like "Please wait"), then do some stuff
> and
> destroy the Dialog afterwards. The ideal soulution from my perspective
> would be somethin like
> Dialog d= new Dialog(...);
> d.Run();
> foo();
> d.Destroy();
> The problem is, that I am not able to make Run() return imediately.
> The
> only soultion I see is via threading,which is alwas a hassle with
> gtk#.
> Are there any better ways of displaying a Dialog on the screen ehile
> leaving the control with the program?

You could use a timeout..

Dialog d = new Dialog ();
GLib.Timeout.Add (10, new GLib.TimeoutHandler (foo));
d.Run ();

More information about the Gtk-sharp-list mailing list