[maemo-developers] [maemo-developers] gtk-infoprint

From: Eero Tamminen eero.tamminen at movial.fi
Date: Mon May 29 09:57:53 EEST 2006

> Where you call sleep(), you should run the main loop manually or
> better, return  from the function if possible. If you need to do stuff
> in place of sleep(), you should follow the example in GTK+
> documentation:
> Example 2. Updating the GUI during a long computation.
>    /* computation going on */
>    ...
>           while (gtk_events_pending ())
>	         gtk_main_iteration ();

It should of course be noted that normally the code should react just
to user (and network) events, not poll like above because on a device
with the battery that is extremely bad coding.

The above example is *really* meant only for the case when you have
some computation going which allows the main loop to be run occasionally
so that GUI events (like animation) can be processed.

	- Eero

More information about the maemo-developers mailing list