3.32 menu-item%
Implements: selectable-menu-item<%>
A menu-item% is a plain string-labelled menu item. Its
parent must be a menu% or popup-menu%. When the
user selects the menu item, its callback procedure is called.
(->newmenu-item% (label_) (parent_) (callback_) [(shortcut_)] [(help-string_)] [(demand-callback_)])menu-item%object
label: string (up to 200 characters)
parent:menu%orpopup-menu%object
callback: procedure of two arguments: amenu-item%object and acontrol-event%object
shortcut=#f: character or#f
help-string=#f: string (up to 200 characters) or#f
demand-callback=: procedure of one argument: avoidmenu-item%objectCreates a new menu item in
parent. The item is initially shown, appended to the end of its parent. Thecallbackprocedure is called (with the event type'menu) when the user selects the menu item (either via a menu bar,popup-menuinwindow<%>, orpopup-menuineditor-admin%).See
set-labelfor information about mnemonic ampersands (``&'') inlabel.If shortcut is not
#f, the item has a shortcut. Seeget-shortcutfor more information.If
help-stringis not#f, the item has a help string. Seeget-help-stringfor more information.The
demand-callbackprocedure is called by the defaulton-demandmethod with the object itself.
Methods
delete
get-parent
is-deleted?
restore
All Methods
command from selectable-menu-item<%>
delete from menu-item<%>
enable from labelled-menu-item<%>
get-help-string from labelled-menu-item<%>
get-label from labelled-menu-item<%>
get-parent from menu-item<%>
get-plain-label from labelled-menu-item<%>
get-shortcut from selectable-menu-item<%>
get-x-shortcut-prefix from selectable-menu-item<%>
is-deleted? from menu-item<%>
is-enabled? from labelled-menu-item<%>
on-demand from labelled-menu-item<%>
restore from menu-item<%>
set-help-string from labelled-menu-item<%>
set-label from labelled-menu-item<%>
set-shortcut from selectable-menu-item<%>
set-x-shortcut-prefix from selectable-menu-item<%>