diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-02-22 18:31:35 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2016-02-23 08:06:02 -0500 |
commit | 400b08b164147447ae77669bd03fdaac74e6a499 (patch) | |
tree | 460e6b8f881dcace0fd7850b234924c0e45c845a /perl-install/mygtk3.pm | |
parent | 7050de664fe771d47045091f9177dc41b518a8cf (diff) | |
download | drakx-400b08b164147447ae77669bd03fdaac74e6a499.tar drakx-400b08b164147447ae77669bd03fdaac74e6a499.tar.gz drakx-400b08b164147447ae77669bd03fdaac74e6a499.tar.bz2 drakx-400b08b164147447ae77669bd03fdaac74e6a499.tar.xz drakx-400b08b164147447ae77669bd03fdaac74e6a499.zip |
enable to use WebKit2 with mygtk3
Diffstat (limited to 'perl-install/mygtk3.pm')
-rw-r--r-- | perl-install/mygtk3.pm | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/mygtk3.pm b/perl-install/mygtk3.pm index da057b856..2662439ce 100644 --- a/perl-install/mygtk3.pm +++ b/perl-install/mygtk3.pm @@ -603,12 +603,21 @@ sub _gtk__TextView { $w; } + +sub _gtk__WebKit2_WebView { + my ($w, $opts, $class, $_action) = @_; + _gtk__WebKit_WebView($w, $opts, $class, $_action); +} + sub _gtk__WebKit_WebView { - my ($w, $opts, $_class, $_action) = @_; + my ($w, $opts, $class, $_action) = @_; if (!$w) { - require Gtk3::WebKit; - Gtk3::WebKit->import; # needed for initializing introspection - $w = Gtk3::WebKit::WebView->new; + $class =~ s/_([^_]*)$/::$1/; + my $base_class = "Gtk3::$class"; + $base_class =~ s/_WebView$//; + eval "require $base_class"; + $base_class->import; # needed for initializing introspection + $w = $base_class->new; } # disable contextual menu: |