summaryrefslogtreecommitdiffstats
path: root/library/ttk/menubutton.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/ttk/menubutton.tcl')
-rw-r--r--library/ttk/menubutton.tcl14
1 files changed, 7 insertions, 7 deletions
diff --git a/library/ttk/menubutton.tcl b/library/ttk/menubutton.tcl
index bb947c2..a245df8 100644
--- a/library/ttk/menubutton.tcl
+++ b/library/ttk/menubutton.tcl
@@ -5,7 +5,7 @@
#
# Pulldown: Press menubutton, drag over menu, release to activate menu entry
# Popdown: Click menubutton to post menu
-# Keyboard: <Key-space> or accelerator key to post menu
+# Keyboard: <space> or accelerator key to post menu
#
# (In addition, when menu system is active, "dropdown" -- menu posts
# on mouse-over. Ttk menubuttons don't implement this).
@@ -19,7 +19,7 @@
# This won't work for Ttk menubuttons in pulldown mode,
# since we need to process the final <ButtonRelease> event,
# and this might be delivered to the menu. So instead we
-# rely on the passive grab that occurs on <ButtonPress> events,
+# rely on the passive grab that occurs on <Button> events,
# and transition to popdown mode when the mouse is released
# or dragged outside the menubutton.
#
@@ -46,15 +46,15 @@ namespace eval ttk {
bind TMenubutton <Enter> { %W instate !disabled {%W state active } }
bind TMenubutton <Leave> { %W state !active }
-bind TMenubutton <Key-space> { ttk::menubutton::Popdown %W }
+bind TMenubutton <space> { ttk::menubutton::Popdown %W }
bind TMenubutton <<Invoke>> { ttk::menubutton::Popdown %W }
if {[tk windowingsystem] eq "x11"} {
- bind TMenubutton <ButtonPress-1> { ttk::menubutton::Pulldown %W }
+ bind TMenubutton <Button-1> { ttk::menubutton::Pulldown %W }
bind TMenubutton <ButtonRelease-1> { ttk::menubutton::TransferGrab %W }
bind TMenubutton <B1-Leave> { ttk::menubutton::TransferGrab %W }
} else {
- bind TMenubutton <ButtonPress-1> \
+ bind TMenubutton <Button-1> \
{ %W state pressed ; ttk::menubutton::Popdown %W }
bind TMenubutton <ButtonRelease-1> \
{ if {[winfo exists %W]} { %W state !pressed } }
@@ -224,11 +224,11 @@ proc ttk::menubutton::TransferGrab {mb} {
# FindMenuEntry --
# Hack to support tk_optionMenus.
# Returns the index of the menu entry with a matching -label,
-# -1 if not found.
+# "" if not found.
#
proc ttk::menubutton::FindMenuEntry {menu s} {
set last [$menu index last]
- if {$last eq "none"} {
+ if {$last eq "none" || $last eq ""} {
return ""
}
for {set i 0} {$i <= $last} {incr i} {