summaryrefslogtreecommitdiffstats
path: root/library/demos
diff options
context:
space:
mode:
authormarc_culler <marc.culler@gmail.com>2020-11-20 18:00:36 (GMT)
committermarc_culler <marc.culler@gmail.com>2020-11-20 18:00:36 (GMT)
commit48fdc423baf96522eb2cc18da475e9a5f38f3e35 (patch)
tree86281f82dc8b883bb867e74ed8fa5d1e2367dd6f /library/demos
parentee5d4d7278fd734cb10f9d8baec6452d4d478f61 (diff)
parent668ebaa67fe5da07f034c1ac75d49f95cafdfad8 (diff)
downloadtk-48fdc423baf96522eb2cc18da475e9a5f38f3e35.zip
tk-48fdc423baf96522eb2cc18da475e9a5f38f3e35.tar.gz
tk-48fdc423baf96522eb2cc18da475e9a5f38f3e35.tar.bz2
Merge 8.6
Diffstat (limited to 'library/demos')
-rw-r--r--library/demos/menu.tcl21
1 files changed, 18 insertions, 3 deletions
diff --git a/library/demos/menu.tcl b/library/demos/menu.tcl
index a76bd54..fbb0069 100644
--- a/library/demos/menu.tcl
+++ b/library/demos/menu.tcl
@@ -151,9 +151,24 @@ $m entryconfigure "Does almost nothing also" -image lilearth -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"} {
+ # Aqua ignores the -background and -foreground options, but a compound
+ # button can be used for selecting colors.
+ foreach i {red orange yellow green blue} {
+ 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 {
+ 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