summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-03-01 01:54:19 +0000
committerNorbert Preining <preining@logic.at>2010-03-01 01:54:19 +0000
commit904fd0757fe037dbfbf156b31f72e5ff5c7cd796 (patch)
tree36f000ab754854574aad17c01d9cd9ac739f1053 /Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl
parent402bd194f686177d2dfca24f7c4766434c514141 (diff)
commit more files of the tlperl.straw dir, still not complete
git-svn-id: svn://tug.org/texlive/trunk@17244 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl')
-rwxr-xr-xMaster/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl44
1 files changed, 44 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl b/Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl
new file mode 100755
index 00000000000..a5f9a10c093
--- /dev/null
+++ b/Master/tlpkg/tlperl.straw/lib/Tk/demos/widget_lib/check.pl
@@ -0,0 +1,44 @@
+# check.pl
+
+use vars qw/$TOP/;
+
+sub check {
+
+ # Create a top-level window that displays a bunch of check buttons.
+
+ my($demo) = @_;
+ $TOP = $MW->WidgetDemo(
+ -name => $demo,
+ -text => 'Three checkbuttons are displayed below. If you click on a button, it will toggle the button\'s selection state and set a Perl variable to a value indicating the state of the checkbutton. Click the "See Variables" button to see the current values of the variables.',
+ -title => 'Checkbutton Demonstration',
+ -iconname => 'check',
+ );
+
+ my $var = $TOP->Button(
+ -text => 'See Variables',
+ -command => [\&see_vars, $TOP, [
+ ['wipers', \$WIPERS],
+ ['brakes', \$BRAKES],
+ ['sober', \$SOBER],
+ ],
+ ],
+ );
+ $var->pack(qw/-side bottom -expand 1/);
+
+ my(@pl) = qw/-side top -pady 2 -anchor w/;
+ my $b1 = $TOP->Checkbutton(
+ -text => 'Wipers OK',
+ -variable => \$WIPERS,
+ -relief => 'flat')->pack(@pl);
+ my $b2 = $TOP->Checkbutton(
+ -text => 'Brakes OK',
+ -variable => \$BRAKES,
+ -relief => 'flat')->pack(@pl);
+ my $b3 = $TOP->Checkbutton(
+ -text => 'Driver Sober',
+ -variable => \$SOBER,
+ -relief => 'flat')->pack(@pl);
+
+} # end check
+
+1;