summaryrefslogtreecommitdiffstats
path: root/library/demos/button.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/demos/button.tcl')
-rw-r--r--library/demos/button.tcl12
1 files changed, 5 insertions, 7 deletions
diff --git a/library/demos/button.tcl b/library/demos/button.tcl
index d11416c..bb943e6 100644
--- a/library/demos/button.tcl
+++ b/library/demos/button.tcl
@@ -7,6 +7,8 @@ if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
+package require Tk
+
set w .button
catch {destroy $w}
toplevel $w
@@ -17,20 +19,16 @@ positionWindow $w
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."
pack $w.msg -side top
-frame $w.buttons
-pack $w.buttons -side bottom -fill x -pady 2m
-button $w.buttons.dismiss -text Dismiss -command "destroy $w"
-button $w.buttons.code -text "See Code" -command "showCode $w"
-pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
+## See Code / Dismiss buttons
+pack [addSeeDismiss $w.buttons $w] -side bottom -fill x
proc colorrefresh {w col} {
$w configure -bg $col
- $w.buttons configure -bg $col
if {[tk windowingsystem] eq "aqua"} {
# set highlightbackground of all buttons in $w
set l [list $w]
while {[llength $l]} {
- set l [concat [lrange $l 1 end] [winfo children [set b [lindex $l 0]]]]
+ set l [concat [lassign $l b] [winfo children $b]]
if {[winfo class $b] eq "Button"} {
$b configure -highlightbackground $col
}