The pop-up-menu box allows to
select items of a list in a pop-up menu interface
trigger a computation corresponding to a selected item.
To some extent, it resembles the items-list boxes.
The pop-up-menu box has two inputs :
|
The two outputs are independent from the inputs :
the first output returns the index of the selected item.
the second output : returns the value of the selected item as a text.
To set the menu items, edit the first input, select the box and evaluate.
Click on the menu to select an item. When the box is evaluated :
The first output returns the number corresponding to the selected item. Note that the first menu item is equal to 0.
The second output returns the value of the selected item as text.
Mind locking the box before the evaluation : otherwize, the selected item might be reinitialized (by default to the first item in the list).
The pop-up-menu box can be useful for selecting files in a folder. Connect a folder pathname to the first output of the pop up box : the menu items will stand for the files contained in the folder. The
infile
and outfile boxes are designed to return a
directory pathname
to the files contained in the |
The second input of the menu can be used for triggering an operation using the selected item as parameter. This input must be connected to a function or a box on "lambda" mode with one input or argument.
To set or modify the function associated with the menu, connect a box or function, then evaluate the box .
The lambda function is called when an item is selected. The index of this item is the number returned by the first output. It is the argument of the function. |