From MW online help:
A drop down menu is a list
of options in a floating menu.
You can select any of
these options, but only one option per menu can be selected at a time. If you
select a second option, the first one becomes unselected. The name of the drop
down menu can be used as a reporter to report the position of the current
selection in the menu. The position is reported as a number. You can also
getlabel to report the text of the current selection, instead of
its position in the list.
Drop down menus can be used directly on a page
or it can be placed inside a dialog box This section covers the use of drop
down menus on pages. Also see the section on Dialog Boxes.
Creating a Drop
Choose New Drop Down in the Objects menu. The drop
down menu dialog box appears. In this example, the name is set to ColSelect.
The name is a reporter that reports which item is currently selected in the
menu. It must be a one word name, with no spaces.
Type Red as the first
label. Labels are the text items that appear in the menu.
Click on Insert to add
this label to the list.
Do this for other
colors. The labels are displayed in the larger area:
If you make a mistake,
select the item and click on Delete. You can use the Up and Down buttons to rearrange the order of the
items in the box.
Whatever item of the list is selected when you close
this dialog box will be pre-selected when the Drop down menu is first
displayed. If you want none of the choices pre-selected, click on Unselect. The
default value is also the item that is selected when the Drop down menu is
inside a dialog box and the dialog box is reset. SeeDialog Boxes.
You can set these
- Show Name - when checked, the name is
visible at the bottom of the drop down menu.
- Visible - if unchecked, the drop down
menu will not be visible.
Click OK to create the drop down
Using a Drop Down Menu
this in the Command Center:
No item has been
selected yet. Click on one of the items and type the same instruction (the
result is just an example)
colselect to control something on the page. Create a turtle and
type this procedure in the turtle's Procedures Tab.
if colselect = 1 [setc "red]
if colselect = 2
if colselect = 3 [setc
fd 2 wait 1
rt random 360
In the turtle's Rules Tab, type
trace in the OnClick
instruction line and set its mode to Forever.
In the turtle's State
Tab, put the turtle's pen down.
Then click on the
turtle to make it draw. As the turtle moves, select different colors in the
drop down menu.
You can also
getlabel to report the actual words used as labels instead of
the position number of the selection in the list.
Type this procedure in another
turtle's Procedures Tab:
fd 5 wait 1
rt random 360
Important: If you plan to use labels (reported
getlabel) instead of position numbers, you should use one-word
labels. The example above would not work if the label was, for example, "fire
getlabel "colorset would report fire red and this is
not accepted as an input for