1

I'm working on a web application using WebKitGtk2 and I need to use the “window-object-cleared” signal with WebKitWebFrame. When I compile it I got an error:

main.cc:11:1: error: ‘WebKitFrame’ does not name a type

Compiled with:

c++ main.cc -w `pkg-config --cflags --libs gtk+-3.0 webkit2gtk-4.0` -o m

I checked on this and tried to use WebKitFrame instead but same thing happening.

This is my code

    GtkWidget *main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_default_size(GTK_WINDOW(main_window), 800, 600);
    WebKitWebView *webView = WEBKIT_WEB_VIEW(webkit_web_view_new());

  
    gtk_container_add(GTK_CONTAINER(main_window), GTK_WIDGET(webView));
    g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), NULL);
    g_signal_connect(webView, "window-object-cleared", G_CALLBACK(woCleared), main_window);

The callback function

void
woCleared (WebKitWebView  *web_view,
               WebKitWebFrame *frame,       /* this line error*/
               gpointer        context,
               gpointer        window_object,
               gpointer        user_data){
      
   // my code

}

Im new with the webkitgtk.

shahril772
  • 53
  • 6

0 Answers0