3.9 checkable-menu-item%
Implements: selectable-menu-item<%>
A checkable-menu-item% is a string-labelled menu item that
maintains a check mark. Its parent must be a menu% or
popup-menu%. When the user selects the menu item, the
item's check mark is toggled and its callback procedure is called.
(->newcheckable-menu-item% (label_) (parent_) (callback_) [(shortcut_)] [(help-string_)] [(demand-callback_)] [(checked_)] [(shortcut-prefix_)])checkable-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: avoidcheckable-menu-item%object
checked=#f: boolean
shortcut-prefix=: list of symbols in(get-default-shortcut-prefix)'(alt cmd meta ctl shift option)Creates a new menu item in
parent. The item is initially shown, appended to the end of its parent, and unchecked. Thecallbackprocedure is called (with the event type'menu) when the menu item is selected (either via a menu bar,popup-menuinwindow<%>, orpopup-menuineditor-admin%).See
set-labelfor information about mnemonic ampersands (``&'') inlabel.If
shortcutis not#f, the item has a shortcut. Seeget-shortcutfor more information. Theshortcut-prefixargument determines the set of modifier keys for the shortcut; seeget-shortcut-prefix.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.By default, the menu item is initially unchecked. If
checkedis true, thencheckis called so that the menu item is initially checked.
Methods
check
is-checked?
All Methods
check from checkable-menu-item%
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-shortcut-prefix from selectable-menu-item<%>
is-checked? from checkable-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-shortcut-prefix from selectable-menu-item<%>