Generic function
Prompt the user to choose from a collection of items, using a pop-up menu.
choose-from-menu items
#key frame owner title value default-item label-key value-key
width height foreground background text-style multiple-sets?
=> value success?
type-union(<sequence>, <menu>).
<frame>. Default value: #f.
<sheet>. Default value: #f.
<string>. Default value: #f.
<object>.
<function>. Default value: identity.
<function>. Default value: identity.
<ink>.
<ink>.
<text-style>.
<object>.
<boolean>.
duim-sheets
duim-sheets
Prompt the user to choose from a collection of items, using a pop-up menu.This generic function is similar to choose-from-dialog.
The function returns the value chosen by the user, and a boolean value: #t if a value was chosen, #f if nothing was chosen.
At its most basic, choose-from-menu can be passed a simple sequence of items, as follows:
choose-from-menu(#(1, 2, 3));
However, any of a large number of keywords can be supplied to specify more clearly the menu that is created. A range of typical options can be chosen: The frame keyword specifies a frame whose top level sheet becomes the owner of the menu. Alternatively, you can specify this top level sheet explicitly using owner. The title keyword lets you choose a title for the dialog. By default, each of these values is #f.
In addition, choose-from-menu offers options similar to collection gadgets, that can act upon the items specified. The default-item keyword lets you specify an item that is returned by default if no value is chosen explicitly (thereby ensuring that success? will always be #t). You can also specify a value-key or label-key for the items in the menu.
Finally, you can configure the appearance of the menu itself. The width and height keywords let you set the size of the menu. The foreground and background keywords let you set the text color and the menu color respectively. The text-style keyword lets you specify a font to display the menu items.