Menu

#1035 Keyboard traversal does not work

obsolete: 8.4a3
open
5
2002-07-05
2001-07-24
Anonymous
No

If you make a menubar out of a Menu widget using
the ". config -menu .mb" command, then try to do
a keyboard traversal of the menu, you get an error
message: "grab failed: window not viewable".

The following script reproduces the problem:

# Create a menubar
#
menu .mb -type menubar
. config -menu .mb
.mb add cascade -label File -underline 0 -menu .mb.file
menu .mb.file -tearoff 0
.mb.file add command -label Exit -command exit

# Create a frame to simulate the rest of the
application.
#
frame .f -width 500 -height 300
pack .f -side top -fill both -expand 1

# Wait a while to let everything settle out...
#
update

# Simulate a keyboard traversal of the menubar
#
event generate . <Alt-f>

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-12-27

    Logged In: YES
    user_id=72656

    see also [ #220945 ] menubutton traversal not working

     
  • Donal K. Fellows

    • assigned_to: nobody --> hobbs
     
  • Joe English

    Joe English - 2002-08-30

    Logged In: YES
    user_id=68433

    See also (closed) bug # 530491 "menu -type menubar breaks
    kbd navigation"

    I'm pretty sure the right solution is "don't do that" -- the
    menu '-type' option should only be set by Tk internals, not
    by user code.

    If this is the case, perhaps it should be clarified in the
    documentation...

     
MongoDB Logo MongoDB