menu Button
menu Button {name} {x} {y} {width} {height} {text}Also searchable as: menu Button
menu Button places a button in the menu window. Clicking it puts the button’s name in
#MenuButton.
Parameters
Section titled “Parameters”| Parameter | Meaning |
|---|---|
name |
The control’s name, used later by menu Get, menu Set and menu Delete. Case does not matter. This is what #MenuButton holds after a click, in capital letters. |
x, y |
Position of the top-left corner. |
width, height |
Size in pixels. |
text |
The caption on the button. |
It uses the current font settings.
Waiting for a click
Section titled “Waiting for a click”#MenuButton keeps the last click until something else is clicked, so clear it before you wait. Comparisons
ignore case, so ok matches OK:
menu Clearmenu Window Size 160 100menu Text ask 10 10 Go on?menu Button ok 10 60 60 25 OKmenu Button cancel 80 60 60 25 Cancelmenu Showset #MenuButton N/Awhile #MenuButton = N/A wait 1if #MenuButton = cancel || #MenuButton = closed display ok Cancelled.else display ok Going on.haltChange the caption later with menu Set.
1.5 and 1.6
Section titled “1.5 and 1.6”- 1.5: a click puts the button’s name in
#MenuButtonin capitals (OK). - 1.6: the name is in lower case (
ok);=ignores case, soif #MenuButton = okworks in both. The button goes into the current default parent, and a second button created with a name already taken appears but does nothing when clicked. See MENU: EasyUO 1.5 and 1.6.
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.