App::Chart::Gtk2::Ex::BindingBits -- helpers for Gtk2::BindingSet etc
use App::Chart::Gtk2::Ex::BindingBits;
$bool = App::Chart::Gtk2::Ex::BindingBits::activate_button_event ($bindings, $event, $object)
Activate bindings for a button press $event. The return is true if a binding was found and activated or false if not.
$event
$event should be a Gtk2::Gdk::Event::Button. The button number is turned into keyval Pointer_Button1 etc, modifiers get release-mask added if it's a button-release event, then simply
Gtk2::Gdk::Event::Button
Pointer_Button1
release-mask
button-release
$bindings->activate ($keyval, $modifiers, $object)
$bindings can be either a Gtk2::BindingSet object or a string name of a binding set for Gtk2::BindingSet->find. As of Gtk 2.18 there's keyvals for buttons 1 through 5. If $event->button is somehow another value then activate_button_event returns 0 as there cannot be any bindings for it.
$bindings
Gtk2::BindingSet
Gtk2::BindingSet->find
$event->button
activate_button_event
See examples/binding-button-event.pl in the sources for a sample program.
For reference, as of Gtk 2.18 the Gtk2::Object method $object->bindings_activate is no good for Pointer_Button1 etc as that bindings_activate trys to go from keyval to hardware keycode then back to keyvals, but there's normally no keycode for the pointer buttons, so it doesn't lookup anything in the BindingSet.
Gtk2::Object
$object->bindings_activate
bindings_activate
Gtk2::BindingSet, Gtk2::Ex::WidgetBits, Gtk2::Gdk::Event::Button
http://user42.tuxfamily.org/chart/index.html
Copyright 2009, 2010 Kevin Ryde
Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Chart is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Chart. If not, see http://www.gnu.org/licenses/.
To install App::Chart, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::Chart
CPAN shell
perl -MCPAN -e shell install App::Chart
For more information on module installation, please visit the detailed CPAN module installation guide.