home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / lib / tk / demos / button.tcl < prev    next >
Text File  |  1998-09-09  |  1KB  |  33 lines

  1. # button.tcl --
  2. #
  3. # This demonstration script creates a toplevel window containing
  4. # several button widgets.
  5. #
  6. # SCCS: @(#) button.tcl 1.3 96/02/16 10:49:33
  7.  
  8. set w .button
  9. catch {destroy $w}
  10. toplevel $w
  11. wm title $w "Button Demonstration"
  12. wm iconname $w "button"
  13. positionWindow $w
  14.  
  15. 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."
  16. pack $w.msg -side top
  17.  
  18. frame $w.buttons
  19. pack $w.buttons -side bottom -fill x -pady 2m
  20. button $w.buttons.dismiss -text Dismiss -command "destroy $w"
  21. button $w.buttons.code -text "See Code" -command "showCode $w"
  22. pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
  23.  
  24. button $w.b1 -text "Peach Puff" -width 10 \
  25.     -command "$w config -bg PeachPuff1"
  26. button $w.b2 -text "Light Blue" -width 10 \
  27.     -command "$w config -bg LightBlue1"
  28. button $w.b3 -text "Sea Green" -width 10 \
  29.     -command "$w config -bg SeaGreen2"
  30. button $w.b4 -text "Yellow" -width 10 \
  31.     -command "$w config -bg Yellow1"
  32. pack $w.b1 $w.b2 $w.b3 $w.b4 -side top -expand yes -pady 2
  33.