From b9f60e4207d0f0bc31bd030be7b52fbf45607ba2 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 26 Sep 2008 13:08:20 +0000 Subject: (_gtk__WebKit_View) add basic support for WeBkit, with ability to disable contextual menu --- perl-install/mygtk2.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'perl-install/mygtk2.pm') diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm index 9e4c870c8..fa024a57d 100644 --- a/perl-install/mygtk2.pm +++ b/perl-install/mygtk2.pm @@ -527,6 +527,24 @@ sub _gtk__TextView { $w; } +sub _gtk__WebKit_View { + my ($w, $opts, $_class, $action) = @_; + if (!$w) { + $w = Gtk2::WebKit::WebView->new; + } + + # disable contextual menu: + if (delete $opts->{no_popup_menu}) { + $w->signal_connect('populate-popup' => sub { + my (undef, $menu) = @_; + $menu->destroy if $menu; + 1; + }); + } + + $w; +} + sub _gtk__ComboBox { my ($w, $opts, $_class, $action) = @_; -- cgit v1.2.1