~ubuntu-branches/ubuntu/vivid/gcl/vivid

« back to all changes in this revision

Viewing changes to gcl-tk/demos/mkCheck.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-03-04 14:29:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020304142959-dey14w08kr7lldu3
Tags: upstream-2.5.0.cvs20020219
ImportĀ upstreamĀ versionĀ 2.5.0.cvs20020219

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# mkCheck w
 
2
#
 
3
# Create a top-level window that displays a bunch of check buttons.
 
4
#
 
5
# Arguments:
 
6
#    w -        Name to use for new top-level window.
 
7
 
 
8
proc mkCheck {{w .c1}} {
 
9
    catch {destroy $w}
 
10
    toplevel $w
 
11
    dpos $w
 
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
    frame $w.frame2
 
18
 
 
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
 
22
 
 
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 \
 
27
            -anchor w
 
28
 
 
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
 
33
}