demos::widget_lib::slide(3)
β¨ NAME β¨
Tk::SlideSwitch β it's a 2-position horizontal or vertical switch, bestie π
(and yes, this page lives in the perl/Tk Documentation set, so you're in the right place π«Ά)
π 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/);
okay so literally copy that vibe and you're already slaying π
πΈ DESCRIPTION πΈ
Tk::SlideSwitch is a Frame-based composite mega-widget β think main character energy, but for widgets π β and it's giving a binary Scale widget surrounded by two Label widgets. The Scale's value can be either 0 or 1, no in-between, periodt.
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. The way that just makes sense π
π 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)Labelconfiguration options π¦-rlabelβ a reference to an array of right (or bottom)Labelconfiguration options π¦
ngl, that's the whole extra list. everything else? straight up Scale options, iykyk β¨
π§ METHODS π§
There are no special methods. literally none. zero. the vibes are the method π
β ADVERTISED WIDGETS β
Component subwidgets can be accessed via the Subwidget method β that's the whole idea, bestie. This mega widget has no advertised subwidgets though, so nothing to go poking at π
π EXAMPLE π
See Synopsis π it's up there, go look, I'll wait π
π BUGS π
This widget uses only the pack geometry manager. no cap. so don't come at it with anything else, it will simply not be the moment π₯
π 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 β the whole search history π
okay bestie that's the entire page, you made it to the end, iconic π this was demos::widget_lib::slide(3) from Tk804.036, dated 2025-07-31 β go build something cute with it, mwah π
π¦ where this page comes from
- alpine 3.23: perl-tk-doc 804.036-r8 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- alpine 3.24: perl-tk-doc 804.036-r8 Β· TCL AND HPND-Pbmplus AND CC-BY-SA-3.0 AND MIT-open-group AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms