rox.Menu | index |
The Menu widget provides an easy way to create menus that allow the user to
define keyboard shortcuts, and saves the shortcuts automatically. You only define
each Menu once, and attach it to windows as required.
Example:
from rox.Menu import Menu, set_save_name, Action, Separator, SubMenu
set_save_name('Edit')
menu = Menu('main', [
SubMenu('File', Menu([
Action('Save', 'save'),
Action('Open Parent', 'up'),
Action('Close', 'close'),
Separator(),
Action('New', 'new')
])),
SubMenu('/Edit', Menu([
Action('Undo', 'undo'),
Action('Redo', 'redo'),
Separator(),
Action('Search...', 'search'),
Action('Goto line...', 'goto'),
Separator(),
Action('Process...', 'process'),
])),
Action('Options', 'show_options', 'F1', stock=g.STOCK_HELP)),
Action('Quit', 'quit', stock=g.STOCK_QUIT),
])
There is also an older syntax, where you pass tuples of strings
to the Menu constructor. This has not been required since 1.9.13.
Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Functions | ||
|