Hi, 

From: mhm26 / drexel.edu (matt)
Subject: Re: TkMenubar + Keyboard Shortcut
Date: Sat, 5 Jun 2004 04:08:40 +0900
Message-ID: <13383d7a.0406041105.716c190b / posting.google.com>
> I'm unfortunately using windows...

On windows version of Tcl/Tk, it seems that  menubutton bindings 
which expected on TkMenubar class don't work properly. 
But 'menu' option of root/toplevel widget looks like working. 
Please try to use the 'menu' option. 

e.g.
---------------------------------------------------------------------
menubar = TkMenu.new(Tk.root)

Tk.root[:menu] = menubar  # use 'menu' option

mfile = TkMenu.new(menubar, :tearoff=>false)
medit = TkMenu.new(menubar, :tearoff=>false)

menubar.add(:cascade, :menu=>mfile, :label=>'File', :underline=>0)
menubar.add(:cascade, :menu=>medit, :label=>'Edit', :underline=>0)

mfile.add(:command, :label=>'Open', :underline=>0, :command=>proc{p 'Open'})
mfile.add(:command, :label=>'Quit', :underline=>0, :command=>proc{exit})

medit.add(:command, :label=>'Copy', :underline=>0, :command=>proc{p 'Copy'})
medit.add(:command, :label=>'Paste', :underline=>0, :command=>proc{p 'Paste'})

txt = TkText.new.pack

Tk.mainloop
---------------------------------------------------------------------
-- 
                                  Hidetoshi NAGAI (nagai / ai.kyutech.ac.jp)