forcing synchronous drawing of widgets



Hi all,

I would like my application to have a splash screen width an image inside
it. I do now like to have a splash screen that is empty, so I want to wait
for the image to be drawed on the Xserver before I continue with the
application.

I thought I could do that with gtk_main_iteration(),  gdk_window_process_updates() and gdk_flush()

        splash_window = window_with_title(CURRENT_VERSION_NAME, GTK_WIN_POS_CENTER_ALWAYS, 0);
        gtk_widget_realize(splash_window); /* needed to create splash_window->window */
        gdk_window_set_decorations(splash_window->window, 0);
        {
                GdkPixbuf* pixbuf= gdk_pixbuf_new_from_file(BLUEFISH_SPLASH_FILENAME,NULL);
                image = gtk_image_new_from_pixbuf(pixbuf);
                gtk_container_add(GTK_CONTAINER(splash_window), image);
                gtk_widget_realize(image);
                g_object_unref(pixbuf);
                gtk_widget_show(image);
        }
        gtk_widget_show(splash_window);
        gdk_window_process_updates(splash_window->window, TRUE);
        while (gtk_events_pending()) {
                gtk_main_iteration();
        }
        while (gdk_events_pending()) {
                gdk_flush();
        }

on a local X server this seems to work, but on a remote X server the
program is running already when there is only an empty window..

How can I check if the image is already drawn on the Xserver before I
continue?

thanks,
        Olivier

Attachment: pgpyuSlKBC1yk.pgp
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]