Skip to content

menu Combo

menu Combo Create {name} {x} {y} {width}
menu Combo Add {name} {text}
menu Combo Select {name} {number}
menu Combo Clear {name}

Also searchable as: menu Combo · combobox · drop-down · dropdown

menu Combo places a drop-down list, where the user picks one entry, and manages its entries.

Form What it does
Create {name} {x} {y} {width} Places an empty drop-down list. It uses the current font settings.
Add {name} {text} Adds an entry at the end.
Select {name} {number} Selects entry number, counting from 1. 0 selects nothing.
Clear {name} Removes every entry.

menu Get returns the number of the selected entry, counting from 1, or 0 when nothing is selected.

menu Clear
menu Window Size 160 80
menu Combo Create town 10 10 120
menu Combo Add town Britain
menu Combo Add town Trinsic
menu Combo Add town Vesper
menu Combo Select town 1
menu Button ok 10 45 60 25 OK
menu Show
set #MenuButton N/A
while #MenuButton = N/A
wait 1
menu Get town
display ok You chose town number #MenuRes
halt
  • 1.5: Add, Select and Clear act on every combo box with that name.
  • 1.6: they act on the one combo box the name belongs to; a second one created with the same name is out of reach. The combo box goes into the current default parent.

See also

Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.

The EasyUO 1.6 behaviour on this page was researched with help from the ScriptUO community: Gaderian's tutorial New Menu Code and how to adapt old scripts and the scripts its members share at scriptuo.com.