[webkit-gtk] top level window's expose

biswa biswaranjan.nitrkl at gmail.com
Tue Aug 9 03:47:26 PDT 2011


Hi all,
I was trying to create a GTK_TOP_LEVEL window, attach a webview on that and 
connect a signal handler to handle the expose events. However I observe that on 
attaching the webview to the top level window, my callback function is not 
called.

Can anyone suggest any reason for this or any way by which my call back can be 
called.
My program is as follows:


WebKitWebView *webView=NULL;
GtkWidget *main_window;

static gboolean my_expose_callback(GtkWidget *widget,GdkEventExpose *event, 
gpointer data)
{
  printf("\nmy function called\n");
  return FALSE;
}
static void createWindow()
{
        main_window= gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_default_size(GTK_WINDOW(main_window), 1280, 720);
        gtk_widget_set_name(main_window, "GtkLauncher");
        webView = WEBKIT_WEB_VIEW(webkit_web_view_new());
        gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));   
        g_signal_connect_after(main_window, "expose-event",G_CALLBACK 
(my_expose_callback), NULL);
}


int main(int argc, char* argv[])
{
        gtk_init(NULL, NULL);
        if (!g_thread_supported())
                g_thread_init(NULL);
        createWindow();
        gchar *uri =("http://www.google.com");
        webkit_web_view_load_uri(webView,uri);
        gtk_widget_grab_focus(GTK_WIDGET(webView));
        gtk_widget_show_all(main_window);
        gtk_main();

        return 0;
}

In the above program "my_expose_callback" is not called even 
though the webpage is displayed.



More information about the webkit-gtk mailing list