In case you missed Eero's message (or point)...

2006/5/26, Laszlo T. <[EMAIL PROTECTED]>:

> Hello,
>
>
>
> /* For another example: */
>
>
>
> #include <hildon-widgets/hildon-app.h>
> #include <hildon-widgets/hildon-appview.h>
> #include <hildon-widgets/gtk-infoprint.h>
> #include <gtk/gtk.h>
>
>
>
> static gint infoprint_type = 1;
>
>
> /* Callback to show infoprints */
> void show_infoprint(GtkButton * widget, HildonApp * app)
> {
>     switch (infoprint_type) {
>     case 1:  /* no animation, only sleep */
> /*       gtk_infoprint(GTK_WINDOW(app), "Hi there!"); */
>         gtk_banner_show_animation(GTK_WINDOW(app), "Hi
there!");
>     sleep(5);
>     gtk_banner_close( GTK_WINDOW(app) );
>         break;

The banner is created and the program stops to sleep for five seconds,
then immediately removes the banner. No main loop iterations are run
so no animation.

>     case 2: /* animation AFTER the sleep, I don't understand. */
> /*        gtk_infoprint_with_icon_stock(GTK_WINDOW(app),
>                                       "This is save
icon", GTK_STOCK_SAVE);*/
>         gtk_banner_show_animation(GTK_WINDOW(app), "Hi
there!");
>     sleep(5);
>         break;

The banner is created and the program stops to sleep for five seconds,
then returns to main loop which animates the banner.

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 ();
...
        /* computation continued */
"

--
Kalle Vahlman, [EMAIL PROTECTED]
Powered by http://movial.fi
Interesting stuff at http://syslog.movial.fi
_______________________________________________
maemo-developers mailing list
[email protected]
https://maemo.org/mailman/listinfo/maemo-developers

Reply via email to