Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to include a webkit webview within my c++ application. My project uses Glade ui, and I embedded webview into a scrolled window.

What I do not understand at all is this awkward output + the url is not loaded:

zubozrout@frozenlinux:~/Downloads/Devel/ssm4/usr/bin$ g++ ssm.cpp -o steamskinmanager `pkg-config --cflags --libs gtk+-3.0` `pkg-config --cflags --libs webkitgtk-3.0` && ./steamskinmanager

No bp log location saved, using default.
[000:000] Cpu: 6.58.9, x4, 2401Mhz, 9447MB
[000:000] Computer model: Not available
[000:000] Browser XEmbed support present: 1
[000:000] Browser toolkit is Gtk2.
[000:000] Using Gtk2 toolkit
No bp log location saved, using default.
[000:000] Cpu: 6.58.9, x4, 2401Mhz, 9447MB
[000:000] Computer model: Not available
[000:013] Warning(optionsfile.cc:47): Load: Could not open file, err=2
[000:013] No bp log location saved, using default.
[000:014] Cpu: 6.58.9, x4, 2401Mhz, 9447MB
[000:014] Computer model: Not available
[000:014] Browser XEmbed support present: 1
[000:014] Browser toolkit is Gtk2.
[000:014] Using Gtk2 toolkit
[000:013] Warning(optionsfile.cc:47): Load: Could not open file, err=2
[000:013] No bp log location saved, using default.
[000:014] Cpu: 6.58.9, x4, 2401Mhz, 9447MB
[000:014] Computer model: Not available

Here is the webview part of my code:

builder = gtk_builder_new ();
gtk_builder_add_from_file(builder, "ui.glade", NULL);
window = GTK_WIDGET(gtk_builder_get_object (builder, "window"));
gtk_builder_connect_signals(builder, NULL);

[...]

GObject* webview_help;
webview_help = gtk_builder_get_object(builder, "webview_help");
WebKitWebView *webview = WEBKIT_WEB_VIEW(webkit_web_view_new());

gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(webview_help), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
g_object_ref_sink(G_OBJECT(webview));
gtk_container_add(GTK_CONTAINER(webview_help), GTK_WIDGET(webview));
webkit_web_view_load_uri(webview, "http://www.google.com");
g_object_unref(webview);

Unfortunately, there are not many tutorials describing gtk webview usage. As an inspiration, I used this (it it probable I missed something). Sadly, I can't find the solution to my problem.

Thank you very much for your help.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Oh, sorry - it was simple yet I was not able to find out what is causing it. The answer is not to forget to show the webview widget.

gtk_widget_show(GTK_WIDGET(webview));

But I still have the awkward terminal output that I would like to get rid of.

share|improve this answer
    
It may be vital to say the strange console output is caused by this function: webkit_web_view_load_uri(webview, "http://www.google.com"); –  zubozrout Oct 9 '13 at 2:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.