]>
git.zerfleddert.de Git - micropolis/blob - src/tk/library/demos/mkCheck.tcl
3 # Create a top-level window that displays a bunch of check buttons.
6 # w - Name to use for new top-level window.
8 proc mkCheck
{{ w .c1
}} {
12 wm title
$w "Checkbutton demonstration"
13 wm iconname
$w "Checkbuttons"
14 message $w .msg
-font -Adobe - times
- medium
- r
- normal
--* -180 * -aspect 300 \
15 -text "Three checkbuttons are displayed below. If you click on a button, it will toggle the button's selection state and set a Tcl variable to a value indicating the state of the checkbutton. Click the \" See Variables \" button to see the current values of the variables. Click the \" OK \" button when you've seen enough."
16 frame $w .
frame -borderwidth 10
17 pack append $w .
frame \
18 [ checkbutton $w .
frame .b1
-text "Wipers OK" -variable wipers
\
19 -relief flat
] { top pady
4 expand
frame w
} \
20 [ checkbutton $w .
frame .b2
-text "Brakes OK" -variable brakes
\
21 -relief flat
] { top pady
4 expand
frame w
} \
22 [ checkbutton $w .
frame .b3
-text "Driver Sober" -variable sober
\
23 -relief flat
] { top pady
4 expand
frame w
}
25 pack append $w .frame2
\
26 [ button $w .frame2.ok
-text OK
-command "destroy $w " ] \
28 [ button $w .frame2.vars
-text "See Variables" \
29 -command "showVars $w .dialog wipers brakes sober" ] \
31 button $w .ok
-text OK
-command "destroy $w "
33 pack append $w $w .msg
{ top fill
} $w .
frame { top expand fill
} \
34 $w .frame2
{ bottom fill
}