3.38 popup-menu%
Implements: menu-item-container<%>
A popup-menu% object is created without a
parent. Dynamically display a popup-menu% with
,
popup-menu in window<%>, or
popup-menu in editor-admin%.
A popup menu is not a control. A choice% control,
however, displays a single value that the user selects from a popup
menu. A choice% control's popup menu is built into the
control, and it is not accessible to the programmer.
(->newpopup-menu% [(title_)] [(popdown-callback_)] [(demand-callback_)] [(font_)])popup-menu%object
title=#f: string (up to 200 characters) or#f
popdown-callback=: procedure of two arguments: a(lambda(me) (void))popup-menu%object and acontrol-event%object
demand-callback=: procedure of one argument: avoidpopup-menu%object
font=:normal-control-fontfont%objectIf
titleis not#f, it is used as a displayed title at the top of the popup menu.If
titlecontains an ampersand (``&''), it is handled specially, the same as formenu%titles. A popup menu mnemonic is not useful, but it is supported for consistency with other menu labels.The
popdown-callbackprocedure is invoked when a popup menu is dismissed. If the popup menu is dismissed without an item being selected,popdown-callbackis given acontrol-event%object with the event type'menu-popdown-none. If the popup menu is dismissed via an item selection, the item's callback is invoked first, and thenpopdown-callbackis given acontrol-event%object with the event type'menu-popdown.The
demand-callbackprocedure is called by the defaulton-demandmethod with the object itself.The
fontargument determines the font for the popup menu's items.
Methods
get-font
get-popup-target
set-min-width
All Methods
get-font from popup-menu%
get-items from menu-item-container<%>
get-popup-target from popup-menu%
on-demand from menu-item-container<%>
set-min-width from popup-menu%