Tk::demos::widget_lib::slide - a 2 position horizontal or vertical switch.
use Tk::SlideSwitch; my $sl = $frame1->SlideSwitch( -bg => 'gray', -orient => 'horizontal', -command => [$self => 'on'], -llabel => [-text => 'OFF', -foreground => 'blue'], -rlabel => [-text => 'ON', -foreground => 'blue'], -troughcolor => 'tan', )->pack(qw/-side left -expand 1/);
perl/Tk Documentation demos::widget_lib::slide(3)
NAME
Tk::SlideSwitch - a 2 position horizontal or vertical switch.
SYNOPSIS
use Tk::SlideSwitch;
my $sl = $frame1->SlideSwitch(
-bg => 'gray',
-orient => 'horizontal',
-command => [$self => 'on'],
-llabel => [-text => 'OFF', -foreground => 'blue'],
-rlabel => [-text => 'ON', -foreground => 'blue'],
-troughcolor => 'tan',
)->pack(qw/-side left -expand 1/);
DESCRIPTION
Tk::SlideSwitch is a Frame based composite mega-widget featuring a
binary Scale widget surrounded by two Label widgets. The Scale's value
can be either 0 or 1. The Labels are positioned to the left and right
of the Scale if its orientation is horizontal, else on the top and
bottom of the Scale.
OPTIONS
In addition to all Scale options, the following option/value pairs are
also supported:
-llabel
A reference to an array of left (or top) Label configuration
options.
-rlabel
A reference to an array of right (or bottom) Label configuration
options.
METHODS
There are no special methods.
ADVERTISED WIDGETS
Component subwidgets can be accessed via the Subwidget method. This
mega widget has no advertised subwidgets.
EXAMPLE
See Synopsis.
BUGS
This widget uses only the pack geometry manager.
AUTHOR
sol0@Lehigh.EDU
Copyright (C) 2002 - 2003, Steve Lidie. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
KEYWORDS
SlideSwitch, Scale
ATTRIBUTES
See attributes(7) for descriptions of the following attributes:
+---------------+----------------------------+
|ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+---------------+----------------------------+
|Availability | library/perl-5/perl-tk-532 |
+---------------+----------------------------+
|Stability | Volatile |
+---------------+----------------------------+
NOTES
Source code for open source software components in Oracle Solaris can
be found at https://www.oracle.com/downloads/opensource/solaris-source-
code-downloads.html.
This software was built from source available at
https://github.com/oracle/solaris-userland. The original community
source was downloaded from
http://search.cpan.org/CPAN/authors/id/S/SR/SREZIC/Tk-804.036.tar.gz.
Further information about this software can be found on the open source
community website at http://search.cpan.org/~srezic/Tk.
Tk804.036 2013-11-15
demos::widget_lib::slide(3)