summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorculler <culler>2020-11-17 22:26:10 (GMT)
committerculler <culler>2020-11-17 22:26:10 (GMT)
commit517cab46b3a8d51a7a7c35be459168dadf549cd8 (patch)
tree1fb1e4b7d07814ff304922513734133482b3081f /library
parent9d94caca32ae897acbb3fb2e32f97f8cb81f2de8 (diff)
downloadtk-517cab46b3a8d51a7a7c35be459168dadf549cd8.zip
tk-517cab46b3a8d51a7a7c35be459168dadf549cd8.tar.gz
tk-517cab46b3a8d51a7a7c35be459168dadf549cd8.tar.bz2
Make the menu demo look like the old one, by using -foreground instead of -background in aqua.
Diffstat (limited to 'library')
-rw-r--r--library/demos/menu.tcl14
1 files changed, 11 insertions, 3 deletions
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 6989523..56a29da 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -144,9 +144,17 @@ $m entryconfigure "Does almost nothing" -bitmap questhead -compound left \
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
menu $m -tearoff 1
-foreach i {red orange yellow green blue} {
- $m add command -label $i -background $i -command [list \
- puts "You invoked \"$i\"" ]
+if {[tk windowingsystem] eq "aqua"} {
+ # In aqua, changing the background actually adds a colored underline.
+ foreach i {red orange yellow green blue} {
+ $m add command -label $i -foreground $i -command [list \
+ puts "You invoked \"$i\"" ]
+ }
+} else {
+ foreach i {red orange yellow green blue} {
+ $m add command -label $i -background $i -command [list \
+ puts "You invoked \"$i\"" ]
+ }
}
$w configure -menu $w.menu