4 ms·
Uh... yes you can: Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(""); Gtk::Window window; window.set_default_size(1366, 768); WebKitW
by jakearmitage 6y ago
Uh... yes you can:
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create("");
Gtk::Window window;
window.set_default_size(1366, 768);
WebKitWebContext* context = webkit_web_context_new_ephemeral();
WebKitCookieManager* cookies = webkit_web_context_get_cookie_manager(context);
WebKitWebView* widget = WEBKIT_WEB_VIEW(webkit_web_view_new_with_context(context));
Gtk::Widget* wrapper = Glib::wrap(GTK_WIDGET(widget));
WebKitSettings* settings = webkit_web_view_get_settings(widget);
Gtk::Box layout(Gtk::ORIENTATION_VERTICAL);
window.add(layout);
webkit_web_view_load_uri(widget, parse_address(argv[1]).c_str());
window.show_all();
app->run(window);
exit(0);
Done.
- adamjs 6y agoFWIW Ultralight isn't tied to GTK or any windowing system (API is platform-agnostic), also the core Renderer API doesn't even require a run loop (this is vitally important if you're integrating HTML UI into complex environments like games and headless apps).