summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authorculler <culler>2020-11-19 18:47:57 (GMT)
committerculler <culler>2020-11-19 18:47:57 (GMT)
commit14ad08440d4685add2fb7ba440f4ab828153c5e8 (patch)
tree1b482d03615fa91101d61766b889cb64378888b6 /library/demos
parent1ba04ba305622a60b6975ce3780696310b158ec5 (diff)
downloadtk-14ad08440d4685add2fb7ba440f4ab828153c5e8.zip
tk-14ad08440d4685add2fb7ba440f4ab828153c5e8.tar.gz
tk-14ad08440d4685add2fb7ba440f4ab828153c5e8.tar.bz2
Implement option 3 - ignore menu colors on macOS.
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/menu.tcl11
1 files changed, 9 insertions, 2 deletions
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index 56a29da..62991f3 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -145,9 +145,16 @@ set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
menu $m -tearoff 1
if {[tk windowingsystem] eq "aqua"} {
- # In aqua, changing the background actually adds a colored underline.
+ # Aqua ignores the -background and -foreground options, but a compound
+ # button can be used for selecting colors.
foreach i {red orange yellow green blue} {
- $m add command -label $i -foreground $i -command [list \
+ image create photo image_$i -height 16 -width 16
+ image_$i put black -to 0 0 16 1
+ image_$i put black -to 0 1 1 16
+ image_$i put black -to 0 15 16 16
+ image_$i put black -to 15 1 16 16
+ image_$i put $i -to 1 1 15 15
+ $m add command -label $i -image image_$i -compound left -command [list \
puts "You invoked \"$i\"" ]
}
} else {