Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / lib / tk8.4 / demos / button.tcl
blob896f72c6ebda4919a3610ec85829e6901776b002
1 # button.tcl --
3 # This demonstration script creates a toplevel window containing
4 # several button widgets.
6 # RCS: @(#) $Id: button.tcl,v 1.2 1998/09/14 18:23:27 stanton Exp $
8 if {![info exists widgetDemo]} {
9 error "This script should be run from the \"widget\" demo."
12 set w .button
13 catch {destroy $w}
14 toplevel $w
15 wm title $w "Button Demonstration"
16 wm iconname $w "button"
17 positionWindow $w
19 label $w.msg -font $font -wraplength 4i -justify left -text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button. You can press Tab to move among the buttons, then press Space to invoke the current button."
20 pack $w.msg -side top
22 frame $w.buttons
23 pack $w.buttons -side bottom -fill x -pady 2m
24 button $w.buttons.dismiss -text Dismiss -command "destroy $w"
25 button $w.buttons.code -text "See Code" -command "showCode $w"
26 pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
28 button $w.b1 -text "Peach Puff" -width 10 \
29 -command "$w config -bg PeachPuff1; $w.buttons config -bg PeachPuff1"
30 button $w.b2 -text "Light Blue" -width 10 \
31 -command "$w config -bg LightBlue1; $w.buttons config -bg LightBlue1"
32 button $w.b3 -text "Sea Green" -width 10 \
33 -command "$w config -bg SeaGreen2; $w.buttons config -bg SeaGreen2"
34 button $w.b4 -text "Yellow" -width 10 \
35 -command "$w config -bg Yellow1; $w.buttons config -bg Yellow1"
36 pack $w.b1 $w.b2 $w.b3 $w.b4 -side top -expand yes -pady 2