summaryrefslogtreecommitdiffstats
path: root/library/menu.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/menu.tcl')
-rw-r--r--library/menu.tcl19
1 files changed, 9 insertions, 10 deletions
diff --git a/library/menu.tcl b/library/menu.tcl
index 8b29f00..d05740f 100644
--- a/library/menu.tcl
+++ b/library/menu.tcl
@@ -156,16 +156,16 @@ bind Menu <Return> {
bind Menu <Escape> {
tk::MenuEscape %W
}
-bind Menu <Left> {
+bind Menu <<PrevChar>> {
tk::MenuLeftArrow %W
}
-bind Menu <Right> {
+bind Menu <<NextChar>> {
tk::MenuRightArrow %W
}
-bind Menu <Up> {
+bind Menu <<PrevLine>> {
tk::MenuUpArrow %W
}
-bind Menu <Down> {
+bind Menu <<NextLine>> {
tk::MenuDownArrow %W
}
bind Menu <KeyPress> {
@@ -260,7 +260,8 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
set tearoff [expr {[tk windowingsystem] eq "x11" \
|| [$menu cget -type] eq "tearoff"}]
if {[string first $w $menu] != 0} {
- error "can't post $menu: it isn't a descendant of $w (this is a new requirement in Tk versions 3.0 and later)"
+ return -code error -errorcode {TK MENUBUTTON POST_NONCHILD} \
+ "can't post $menu: it isn't a descendant of $w"
}
set cur $Priv(postedMb)
if {$cur ne ""} {
@@ -327,7 +328,7 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
$menu activate $entry
GenerateMenuSelect $menu
}
- }
+ }
right {
set x [expr {[winfo rootx $w] + [winfo width $w]}]
set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}]
@@ -360,14 +361,12 @@ proc ::tk::MbPost {w {x {}} {y {}}} {
}
}
}
- } msg]} {
+ } msg opt]} {
# Error posting menu (e.g. bogus -postcommand). Unpost it and
# reflect the error.
- set savedInfo $errorInfo
MenuUnpost {}
- error $msg $savedInfo
-
+ return -options $opt $msg
}
set Priv(tearoff) $tearoff