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
19
pack $w.msg -side top -fill both
20
pack $w.frame -side top -expand yes -fill both
21
pack $w.frame2 -side bottom -fill both
23
checkbutton $w.frame.b1 -text "Wipers OK" -variable wipers -relief flat
24
checkbutton $w.frame.b2 -text "Brakes OK" -variable brakes -relief flat
25
checkbutton $w.frame.b3 -text "Driver Sober" -variable sober -relief flat
26
pack $w.frame.b1 $w.frame.b2 $w.frame.b3 -side top -pady 2 -expand yes \
29
button $w.frame2.ok -text OK -command "destroy $w"
30
button $w.frame2.vars -text "See Variables" \
31
-command "showVars $w.dialog wipers brakes sober"
32
pack $w.frame2.ok $w.frame2.vars -side left -expand yes -fill both