FLTK::Scrollbar - Controls an integer position of a window of a given size inside a data set of a given total size
The Scrollbar widget displays a slider with arrow buttons at the ends of the scrollbar.
Clicking on the arrows move up/left and down/right by
If the scrollbar has the keyboard focus the arrows move by
and vertical scrollbars take Page Up/Down (they move by the page size minus
linesize( )) and Home/End (they jump to the top or bottom).
Often a widget that takes focus such as the browser will just send keystrokes to the scrollbar directly to get it to move in response.
my $self = $scrollbar->new( $x, $y, $w, $h, $label );
Creates a new FLTK::Scrollbar widget.
my $size = $scrollbar->pagesize( );
$scrollbar->pagesize( $size );
my $value = $scrollbar->value( );
Return the current position of the scrollbar as an integer.
step( 1 ) preset (they always return integers).
If desired you can set the
step( ) to non-integer values.
You will then have to use casts to get at the floating-point versions of
value( ) from the Slider base class.
my $set = $scrollbar->value( $position );
Set the current position of the scrollbar.
my $set = $scrollbar->value( $position, $size, $top, $total );
Set the current position,
slider_size( ) all at once in a useful way.
positionis the position in the data of the first pixel in the window
sizeis the size of the window
topis the position of the top of your data (typically zero)
totalis the total size of your data
Sanko Robinson <email@example.com> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <firstname.lastname@example.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.