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
set_save_name('Edit')
menu = Menu('main', [
('/File', '', '<Branch>'),
('/File/Save', 'save', ''),
('/File/Open Parent', 'up', ''),
('/File/Close', 'close', ''),
('/File/', '', '<Separator>'),
('/File/New', 'new', ''),
('/Edit', '', '<Branch>'),
('/Edit/Undo', 'undo', ''),
('/Edit/Redo', 'redo', ''),
('/Edit/', '', '<Separator>'),
('/Edit/Search...', 'search', ''),
('/Edit/Goto line...', 'goto', ''),
('/Edit/', '', '<Separator>'),
('/Edit/Process...', 'process', ''),
('/Options', 'show_options', ''),
('/Help', 'help', '<StockItem>', 'F1', g.STOCK_HELP),
])
There is also a new syntax, supported from 1.9.13, where you pass instances of MenuItem
instead of tuples to the Menu constructor. Be sure to require version 1.9.13 if
using this feature.
Classes | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Functions | ||
|