Pmw.MenuBar hotkeys

Matthias Huening mhuening at zedat.fu-berlin.de
Tue Jul 30 04:35:49 EDT 2002


Martin Franklin <mfranklin1 at gatwick.westerngeco.slb.com> wrote in
news:mailman.1027968050.16442.python-list at python.org: 

> On Monday 29 Jul 2002 6:23 pm, Matthias Huening wrote:
>> Hi,
>>
>> I seem unable to get the hotkeys to work with Pmw.MenuBar.
>> They should be activated with <ALT>+hotkey, but nothing happens...
>> When a menu is opened, the hotkeys of the different menu items do
>> work. The problem is only with the hotkeys on the menu bar. Any
>> ideas? 
>>
>> Matthias
> 
> Matthias,
> 
> Have you got a small example?  I think I've had these working.....
> 

Okay, here is a minimal example. 
(By the way: WinXP, Python 2.1, Pmw 0.8.5)

Matthias

########

import Pmw
root = Pmw.initialise()

def my_func():
    print 'Something happend'

menubar = Pmw.MenuBar(root, hull_borderwidth = 0, hotkeys=1)
menubar.pack()
menubar.addmenu('File', 'Simple Commands')
menubar.addmenuitem('File', 'command', label='One', command=my_func)
menubar.addmenuitem('File', 'command', label ='Two', command=my_func)

root.mainloop()

########



More information about the Python-list mailing list