[Gtk-sharp-list] Refresh Problem + Sleep

Wolfgang Mauer W.Mauer at top-soft.info
Wed Jan 18 16:49:48 EST 2006


Hi,
i made my own sleep function, may this help

static bool SleepMoveon = false;
static GLib.TimeoutHandler handler = new GLib.TimeoutHandler(SleepStop);
	
static bool SleepStop()
{
	SleepMoveon = true;
	return false;
}

public static void Sleep(uint mSec)
{
	SleepMoveon = false;
	GLib.Timeout.Add(mSec, handler);
	while(true != SleepMoveon)
	{
		while (Application.EventsPending ())
		{
			Application.RunIteration ();
		}
	}
}

Regards
Wolfgang

>Am Mittwoch, 18. Januar 2006 15:15 schrieb Matteo Bertozzi:
> I've a Refresh Problem, with this function...
> I Think that the problem is Thread.Sleep() but I don't know how to
> resolve it...
>
> public static void DW (Gtk.Window window, int millisecondsTimeout) {
>         int screenHeight = window.Screen.Height;
>         int winX, winY;
>
>         do {
>                 window.GetPosition(out winX, out winY);
>                 window.Move(winX, winY + 1);
>                 System.Threading.Thread.Sleep(millisecondsTimeout);
>         } while (winY <= screenHeight);
> }
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list


More information about the Gtk-sharp-list mailing list