summaryrefslogtreecommitdiff
path: root/tk/library/demos/menu.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'tk/library/demos/menu.tcl')
-rw-r--r--tk/library/demos/menu.tcl13
1 files changed, 10 insertions, 3 deletions
diff --git a/tk/library/demos/menu.tcl b/tk/library/demos/menu.tcl
index 9900cd59a1b..9b0f6bb4fe1 100644
--- a/tk/library/demos/menu.tcl
+++ b/tk/library/demos/menu.tcl
@@ -17,7 +17,8 @@ wm iconname $w "menu"
positionWindow $w
label $w.msg -font $font -wraplength 4i -justify left
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
$w.msg configure -text "This window contains a menubar with cascaded menus. You can invoke entries with an accelerator by typing Command+x, where \"x\" is the character next to the command key symbol. The rightmost menu can be torn off into a palette by dragging outside of its bounds and releasing the mouse."
} else {
$w.msg configure -text "This window contains a menubar with cascaded menus. You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu. You can then traverse among the menus using the arrow keys. When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character. If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator. The rightmost menu can be torn off into a palette by selecting the first item in the menu."
@@ -55,7 +56,8 @@ set m $w.menu.basic
$w.menu add cascade -label "Basic" -menu $m -underline 0
menu $m -tearoff 0
$m add command -label "Long entry that does nothing"
-if {$tcl_platform(platform) == "macintosh"} {
+if {[string equal [tk windowingsystem] "classic"]
+ || [string equal [tk windowingsystem] "aqua"]} {
set modifier Command
} elseif {$tcl_platform(platform) == "windows"} {
set modifier Control
@@ -131,6 +133,12 @@ menu $m -tearoff 0
foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Make life meaningful}} {
$m add command -label $i -command [list puts "You invoked \"$i\""]
}
+$m entryconfigure "Does almost nothing" \
+ -bitmap questhead -compound left -command {
+ tk_dialog .compound {Compound Menu Entry} {The menu entry you invoked\
+ displays both a bitmap and a text string. Other than this, it\
+ is just like any other menu entry.} {} 0 OK
+}
set m $w.menu.colors
$w.menu add cascade -label "Colors" -menu $m -underline 1
@@ -150,4 +158,3 @@ bind Menu <<MenuSelect>> {
set menustatus $label
update idletasks
}
-