Re: Gtk3 context menu
- From: Yuri Myasoedov <ymyasoedov yandex ru>
- To: GTK-Perl List <gtk-perl-list gnome org>
- Subject: Re: Gtk3 context menu
- Date: Mon, 25 Aug 2014 22:24:09 +0400
25.08.2014, 10:17, "Daniel Kasak" <d j kasak dk gmail com>:
Hi all. Some code I had that used to work ( I think anyway ) in Gtk2 no longer works:
Hi!
caught: type [button-press] button [3]
obj: $VAR1 = 3;
caught: type [button-press] button [3]
obj: $VAR1 = 3;
caught: type [2button-press] button [HASH(0x480e228)]
obj: $VAR1 = {
'x_root' => '86.7047119140625',
'y_root' => '199.390365600586',
'window' => bless( {}, 'Glib::Object::_Unregistered::GdkX11Window' ),
'time' => 95324125,
'x' => '80.7047119140625',
'send_event' => 0,
'device' => bless( {}, 'Glib::Object::_Unregistered::GdkX11DeviceXI2' ),
'axes' => '3.73453945125965e-316',
'state' => bless( do{\(my $o = 0)}, 'Gtk3::Gdk::ModifierType' ),
'y' => '13.3903656005859',
'button' => 3,
'type' => '2button-press'
};
What's going on? Why is $button sometimes a hash? And why doesn't my menu render properly?
You have 3 events: first click, second click and 2button-press event generated after second click.
For Gtk2 you have the following sequence of arguments:
(Gtk2::Widget, Gtk2::Gdk::Event::Button) - first click
(Gtk2::Widget, Gtk2::Gdk::Event::Button) - second click
(Gtk2::Widget, Gtk2::Gdk::Event::Button) - 2button-press
But when you use Gtk3:
(Gtk2::Widget, Gtk3::Gdk::EventButton) - first click
(Gtk2::Widget, Gtk3::Gdk::EventButton) - second click
(Gtk2::Widget, Gtk3::Gdk::Event) - 2button-press !!!
I have no idea, why Gtk3::Gdk::Event is used instead of Gtk3::Gdk::EventButton. May be a bug?
Anyway you can bless $event for Gtk3::Gdk::EventButton.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]