how to handle idle time
- From: Jim Crafton <jim crafton verizon net>
- Cc: gtk <gtk-app-devel-list gnome org>
- Subject: how to handle idle time
- Date: Fri, 30 May 2003 20:47:36 -0400
Hi,
I am trying to figure out the right way to handle idle time handling, so
that my functions can get called but not use 100% of CPU
Currently i am doing the following:
after gtk_init() has been called (but before gtk_main)
g_idle_add( GTKUIToolkit::internal_gdkIdleHandler,
(gpointer)UIToolkit::getDefaultUIToolkit() );
and internal_gdkIdleHandler is implemented as :
gboolean GTKUIToolkit::internal_gdkIdleHandler(gpointer data)
{
//my code here- currently doesn't doo much of anything
return TRUE;
}
The program runs OK but the CPU usage is at 100%. This happens on Win32.
Is there something I am doing wrong ?
Also what is the right way to handle events to gracefully close the app
down?
Thanks !
Jim
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]