Skip to content

How to use webkit2gtk with glade? #65

@idlesong

Description

@idlesong

In glade, I added a WebKitWebView, then I want to get this object in my code:

        let builder = gtk::Builder::new_from_resource("/im/idlesong/handybox/window.ui");
        let widget: gtk::ApplicationWindow = builder.get_object("window").expect("Failed to find the window object");
        let webview: WebView = builder.get_object("webview").expect("Failed to find label");

It builded success, but when run:

failed to add UI: .:136:1 Invalid object type 'WebKitWebView'

I searched the web, it seems there are only two related answers,
https://stackoverflow.com/questions/51010820/glade-invalid-object-type-webkitwebview-when-loading-from-file-works-on-gla

https://prognotes.net/2019/12/make-a-gtk-web-browser-with-glade/

But one is C, one is Vala. It's too hard to convert to rust for me. Is there any samples or documents about it? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions