[Gtk-sharp-list] GLib.Idle CPU problem
Peter Johanson
peter at peterjohanson.com
Fri Jan 21 10:02:02 EST 2011
Iliya,
Are you returning true or false from your OnIdle callback?
What are you trying to actually accomplish? Application.Idle occurs
*once* when the application is about to enter the idle state. Compare
this to GLib.Idle.Add, which will *continuously* run your IdleHandler
callback over and over until that callback returns false. (compared to
just winforms where the event just fires once when it enters the idle
state).
-pete
On Fri, Jan 21, 2011 at 04:45:34PM +0200, Iliya Iliev wrote:
> Hi,
>
> I'm a newbie in GTK#.
> I'm trying to find an alternative to Winforms Application.Idle event
> and I found GLib.Idle.Add(new IdleHandler(OnIdle)).
> The problem is when I use it my simple program begins to use 50% CPU.
> How to fix this? Or there is another approach to do this ?!?!?
>
> --
> Best regards,
> Iliya Iliev
>
> _______________________________________________
> 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