<<<<<<<<<<<<<<<<<

motif_selection_box(motif) Motif motif_selection_box(motif)

NAME

motif_selection_box - a widget for selecting items from a list

DESCRIPTION

A SelectionBox is a widget that allows the user to select one item from a list. It includes the following: a scrolling list of alternatives, an editable text field for the selected alternative, label for the list and text fields and three buttons. Messages are available to get the id's for a SelectionBox's widgets.

For a more complete description of this Motif widget, consult "OSF/Motif Programmer's Reference."

SUPERCLASS

motif_bulletin_board

INSTANCE VARIABLES

apply_action is an action that is executed when the user clicks the apply button.

cancel_action is an action that is executed when the user clicks the cancel button.

no_match_action is an action that is executed when the user makes a selection from the text edit field that does not have an exact match with any items in the list box.

ok_action is an action that is executed when the user clicks the OK button.

MESSAGES

If the widget underlying the object has not yet been created when a message that returns a widget id is sent, a create! message is sent to the object. Be aware that all actions and some resources must be set before widget creation.

apply_button_id? returns the id of the apply button widget.

cancel_button_id? returns the id of the cancel button widget.

default_button_id? returns the id of the default button widget.

help_button_id? returns the id of the help button widget.

list_id? returns the id of the list widget.

list_label_id? returns the id of the list label widget.

ok_button_id? returns the id of the ok button widget.

selection_label_id? returns the id of the selection label widget.

separator_id? returns the id of the separator button widget.

text_id? returns the id of the text widget.

work_area_id? returns the id of the work_area widget.

@ resource selects resource for a subsequent set or query.

: value sets the current resource to value. Since most resources have mixed case, you should enclose any resource name in quotes. Resource names are the Motif names with the XmN prefix removed. Some resources can only be set before the widget is created. For efficiency, set as many resources as you can before creation.

scalar_value? returns the value of the current resource whose type is integer.

string_value? returns the value of the current resource whose type is string.

pointer_value? returns the value of the current resource whose type is a pointer of any kind.

create! creates an instance of the widget. Any resources that have been specified prior to the create! will be set. An id? message also sends a create!.

on! realizes the widget. Realizing a widget creates

its windows and displays it when it is managed.

EXAMPLE

/* Create a selection box widget */ /* In scripts/motif/selectionbox.scr */

<motifinit <colors

motif application="Selection Box Example"; motif_selection_box new: aSelectionBox parent=motif @ "promptString" : "Select an object to be print!ed" @ width : 256 ok_action=ok create! ; string new: _requested; actions new: ok tick_actions+ " _requested = [aSelectionBox @ `textString' string_value?]; _requested + ` print!;'; parser parse: _requested; " ; motif_list new: box_list id=[aSelectionBox list_id?] add_item: [object instances?] ; motif_text_field new: box_text id=[aSelectionBox text_id?] ; motif on! start!;

SEE ALSO

motif, motif_bulletin_board


Please send comments and suggestions to
consult@rpi.edu