summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authordas <das>2007-05-30 13:23:49 (GMT)
committerdas <das>2007-05-30 13:23:49 (GMT)
commit97ec9f4b0f62c56f8772905a4baee2cd45a68f3d (patch)
tree467aa2c63fcde5c82bee4d4e8562b2b963d8bedd /library/demos
parente37ef892e06f50859941c35f85b7f07ce98d756e (diff)
downloadtk-97ec9f4b0f62c56f8772905a4baee2cd45a68f3d.zip
tk-97ec9f4b0f62c56f8772905a4baee2cd45a68f3d.tar.gz
tk-97ec9f4b0f62c56f8772905a4baee2cd45a68f3d.tar.bz2
replace previous inoperative commit with direct setting of highlightbackground on all buttons
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/button.tcl11
1 files changed, 9 insertions, 2 deletions
diff --git a/library/demos/button.tcl b/library/demos/button.tcl
index 2578e4f..1fbef8d 100644
--- a/library/demos/button.tcl
+++ b/library/demos/button.tcl
@@ -3,7 +3,7 @@
# This demonstration script creates a toplevel window containing
# several button widgets.
#
-# RCS: @(#) $Id: button.tcl,v 1.5 2007/05/30 06:34:18 das Exp $
+# RCS: @(#) $Id: button.tcl,v 1.6 2007/05/30 13:23:49 das Exp $
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
@@ -29,7 +29,14 @@ proc colorrefresh {w col} {
$w configure -bg $col
$w.buttons configure -bg $col
if {[tk windowingsystem] eq "aqua"} {
- $w.buttons configure -highlightbackground $col
+ # set highlightbackground of all buttons in $w
+ set l [list $w]
+ while {[llength $l]} {
+ set l [concat [lassign $l b] [winfo children $b]]
+ if {[winfo class $b] eq "Button"} {
+ $b configure -highlightbackground $col
+ }
+ }
}
}