NAME
Gtk2::Ex::AdjustmentBits -- helpers for Gtk2::Adjustment objects
SYNOPSIS
use Gtk2::Ex::AdjustmentBits;
FUNCTIONS
Scroll
Gtk2::Ex::AdjustmentBits::scroll_value ($adj, $amount)-
Add
$amountto the value in$adj, restricting the result to betweenlowerandupper - page, as suitable for a scrollbar range etc. Gtk2::Ex::AdjustmentBits::scroll_increment ($adj, $inctype)Gtk2::Ex::AdjustmentBits::scroll_increment ($adj, $inctype, $inverted)-
Increment the value in
$adj.$inctype(a string) can be either"step" increment by step_increment() "page" increment by page_increment()If optional parameter
$invertedis true then decrement instead of increment. The scroll is applied perscroll_value()above. $propagate = Gtk2::Ex::AdjustmentBits::scroll_event ($adj, $event)$propagate = Gtk2::Ex::AdjustmentBits::scroll_event ($adj, $event, $inverted)-
Scroll
$adjaccording to$event, aGtk2::Gdk::Event::Scroll.$event->direction()gives the direction"up" decrement "left" decrement "down" increment "right" incrementIf the control key is held down (
control-maskin$event->state()) then the scroll amount ispage_incrementrather thanstep_increment.If optional parameter
$invertedis true then increment/decrement are swapped, so up+left are increment and down+right are decrement.The return value is
Gtk2::EVENT_PROPAGATEwhich may be convenient if called from a widgetscroll-eventsignal handler.The increment direction corresponds to an adjustment used in a
Gtk2::ScrollBar(and itsinvertedproperty), and similar such widgets.
Other
Gtk2::Ex::AdjustmentBits::set_maybe ($adjustment, field => $value, ...)-
Set fields in
$adjustment, with changed and notify signals emitted if the values are different from what's already there. The fields arevalue upper lower page_size page_increment step_incrementFor example
Gtk2::Ex::AdjustmentBits::set_maybe ($adjustment, upper => 100.0, lower => 0.0, value => 50.0);The plain field getter/setters like
$adjustment->upper()don't emit any signals, and the object$adjustment->setonly emitsnotify(orchangedtoo in Gtk 2.18 or thereabouts).set_maybetakes care of all necessary signals and does them only after storing all the values and only if actually changed.Not emitting signals when values are unchanged may save some work in widgets controlled by
$adjustment, though a good widget might notice unchanged values itself. Gtk2::Ex::AdjustmentBits::set_empty ($adj)-
Make
$adjempty by setting its upper, lower, and all values to 0. This is done withset_maybe()above, so if it's already empty nochangedetc signals are emitted.
SEE ALSO
Gtk2::Adjustment, Gtk2::Ex::WidgetBits
HOME PAGE
http://user42.tuxfamily.org/gtk2-ex-widgetbits/index.html
LICENSE
Copyright 2010, 2011, 2012 Kevin Ryde
Gtk2-Ex-WidgetBits 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.
Gtk2-Ex-WidgetBits 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 Gtk2-Ex-WidgetBits. If not, see http://www.gnu.org/licenses/.