From: mhm26@... (matt) Date: 2004-06-04T01:03:38+09:00 Subject: Re: TkMenubar + Keyboard Shortcut Hidetoshi NAGAI wrote in message news:<20040602.110432.74747718.nagai@ai.kyutech.ac.jp>... > 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 > ------------------------------------------------------ I can use up and down once I click on `File' - but I can't use left/right to go between edit and file. I also still can't figure out how to make Alt+F drop down file. Inside your example, I'd like to be able to press Alt+F, Down, Enter in that sequence to open a file... Thanks for all your help, Hidetoshi Matt