Generic function
Prompt the user to choose from a collection of items, using a dialog box.
choose-from-dialog items
#key frame owner title value default-item label-key value-key
selection-mode gadget-class gadget-options width height
foreground background text-style
=> value success?
type-union(<sequence>, <menu>).
<frame>. Default value: #f.
<sheet>. Default value: #f.
<string>.
<object>.
<function>. Default value: identity.
<function>. Default value: identity.
<symbol>. Default value: #"single".
<gadget>.
<sequence>.
<ink>.
<ink>.
<text-style>.
<object>.
<boolean>.
duim-sheets
duim-sheets
Prompt the user to choose from a collection of items, using a dialog box. This generic function is similar to choose-from-menu.
The function returns the values chosen by the user, and a boolean value: #t if a value was chosen, #f if nothing was chosen. Unlike choose-from-menu, the user can choose several values if desired, depending on the value of selection-mode, described below.
At its most basic, choose-from-dialog can be passed a simple sequence of items, as follows:
choose-from-dialog(range(from: 1, to: 10));
However, any of a large number of keywords can be supplied to specify more clearly the dialog 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-dialog 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. The selection-mode keyword is used to make the dialog box single-selection (the user can only choose one value) or multiple-selection (the user can return any number of values). The default value of selection-mode is #"single". By specifying selection-mode: #"multiple", the user can choose several values from the dialog box. The gadget-class keyword lets you specify which type of collection gadget is displayed in the dialog box. This lets you, for example, display a list of check boxes or radio boxes. Finally, gadget-options let you specify a set of options to be applied to the collection gadgets in the dialog box.
You can also 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.