[Gtk-sharp-list] GLib.Idle CPU problem
Iliya Iliev
celyo at mail.bg
Fri Jan 21 10:13:50 EST 2011
Hi,
I'm returning true because I misunderstand that if I want my event
handler to to be executed every time when application goes in Idle state
I should return true.
So is this true that if even I return false from my event handler this
handler will be executed every time when application goes to Idle state?
On 21.01.2011 17:02, Peter Johanson wrote:
> 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
>>
--
Best regards,
Iliya Iliev
More information about the Gtk-sharp-list
mailing list