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>
Logged In: YES
user_id=72656
see also [ #220945 ] menubutton traversal not working
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...