NAME
Tk::MinMaxScale - Two Scale to get a (min, max) pair of values
SYNOPSIS
$mms = $parent->MinMaxScale(-option => value, ... );
$mms = $parent->MinMaxScale( -variablemin => \$vn, -variablemax => \$vx, -labelmin => ..., -labelmax => ..., ..., );
$varmin = $mms->minvalue;
$mms->minvalue(10);
$varmax = $mms->maxvalue;
$mms->maxvalue($var);
DESCRIPTION
Tk::MinMaxScale is a Frame-based widget wrapping two Scale widgets, the first acting as a 'minimum' and the second as a 'maximum'. The value of the 'minimum' Scale is always less than or equal to the value of the 'maximum' Scale.
The purpose of Tk::MinMaxScale is to get a range of values narrower than the whole range given by the options -from and -to (which are applied to both 'minimum' and 'maximum' Scale). This is done through the variables associated to the options -variablemin and -variablemax, or via the methods minvalue and maxvalues, see below.
In addition, dragging a slider while pressing a Shift key drags both sliders, locking their distance. You must hold down the Shift key before dragging a slider.
OPTIONS
The widget accepts all options accepted by Scale (except for -variable option), and their default value (with the exception for -orient option which defaults to 'horizontal').
In addition, the following option/value pairs are supported, but not required:
- -labelmin
-
The text used as a label for the 'minimum' Scale. Default none.
- -labelmax
-
The text used as a label for the 'maximum' Scale. Default none.
- -variablemin
-
A reference to a global variable linked with the 'minimum' Scale.
- -variablemax
-
A reference to a global variable linked with the 'maximum' Scale.
All other options are applied to both 'minimum' and 'maximum' Scale(s).
METHODS
The MinMaxScale method creates a widget object. This object supports the configure and cget methods described in Tk::options which can be used to enquire and modify the options described above. The widget also inherits all the methods provided by the generic Tk::Widget class.
The following additional methods are available for MinMaxScale widgets:
- $mms->minvalue(?value?)
-
If value is defined, sets the 'minimum' Scale of the widget to value (limited by '-from' value and the value of the 'maximum' Scale). Returns the value of the 'minimum' Scale.
- $mms->maxvalue(?value?)
-
If value is defined, sets the 'maximum' Scale of the widget to value (limited by the value of the 'minimum' Scale and '-to' value). Returns the value of the 'maximum' Scale.
BUGS / CAVEAT
At present, you are not allowed to configure -variablemin or -variablemax with a variable attached to another Tk::MinMaxScale widget.
TODO
AUTHOR & LICENSE
Jean-Pierre Vidal, <jeanpierre.vidal@free.fr>
Feedback would be greatly appreciated, including corrections to my poor english.
This package is free software and is provided 'as is' without express or implied warranty. It may be used, modified, and redistributed under the same terms as Perl itself.
SEE ALSO
Tk::Scale
6 POD Errors
The following errors were encountered while parsing the POD:
- Around line 340:
'=item' outside of any '=over'
- Around line 358:
You forgot a '=back' before '=head1'
- Around line 367:
'=item' outside of any '=over'
- Around line 379:
You forgot a '=back' before '=head1'
- Around line 385:
'=item' outside of any '=over'
- Around line 388:
You forgot a '=back' before '=head1'