The pop-up box resembles the items-list boxes :
it allows to select items of a list in a pop-up menu interface
it triggers a computation corresponding to a selected item.
![]() | The pop-up box has two inputs and outputs :
For instance, "piano" can mean "play a piano sound". |
To display the box's interface, evaluate the box and press m
.
To choose an item in the pop up box :
edit the menu item names via the standard procedure – edit the first input, select the box and evaluate.
If necessary, press i
to refresh the displaying of the pop up menu.
To preserve the size of the box, press b
to lock it.
Click on the desired item.
The pop-up box can be useful for selecting files in a folder.
The
infile
and outfile boxes are designed to return a
directory pathname
to the files contained in the in-files
and outfiles
folder of the current workspace.
Connect the output of the box to the first output of the pop up box : the menu items stand for the files contained in the folder.
You can possibly type the directory pathname directly in the first input of the pop up box.
The second input of the menu can be used for selecting an argument and triggering an operation. This input must be connected to a function or a box on "lambda" mode with one input or argument.
This lambda function is called when an item is selected. The value of this item is the number returned by the first output. It is the argument of the function. To set or modify the function associated with the menu, connect a box or function to the second input of the menu box, then evaluate the menubox . | ![]() The value of the selected item – a number between 0 and 2 – is printed in the listener at selection. |
![]() | In the lambda patch, the sequence function evaluates two values successively :
The action programmed in the patch is executed when an item is selected in the pop up box. |