From: Hidetoshi NAGAI Date: 2004-06-02T11:04:39+09:00 Subject: Re: TkMenubar + Keyboard Shortcut Hi, From: Matthew Maycock Subject: Re: TkMenubar + Keyboard Shortcut Date: Tue, 1 Jun 2004 08:50:12 -0400 (EDT) Message-ID: > so I just wanna be able to push Alt+(Some char) and have a menu drop down, > and then be able to use up/down/left/right arrows and other alt > combinations to navigate/execute menu commands. Doesn't it work? On my environment (Tk8.0.5 and 8.5a1), I can use arrow-keys on the following sample. ------------------------------------------------------ require 'tk' menu_spec = [ [['File', 0], ['Open', proc{puts('Open clicked')}, 0], '---', ['Quit', proc{exit}, 0]], [['Edit', 0], ['Cut', proc{puts('Cut clicked')}, 2], ['Copy', proc{puts('Copy clicked')}, 0], ['Paste', proc{puts('Paste clicked')}, 0]] ] menubar = TkMenubar.new(nil, menu_spec, 'tearoff'=>false, 'foreground'=>'grey40', 'activeforeground'=>'red', 'font'=>'Helvetica -12 bold') menubar.pack('side'=>'top', 'fill'=>'x') TkText.new.pack Tk.mainloop ------------------------------------------------------ -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)