|
SpringGUI
introduction download reference examples faq
Reference
Name
|
addChoice()
|
Examples
|
SpringGUI gui;
void setup() {
size(200,200);
gui = new SpringGUI(this); // initialise SpringGUI
// Create a Choice named "myChoice" at coordinates 10,10 with width 200px and height 25px...
gui.addChoice("myChoice", 10, 10, 200, 25);
gui.addItem("myChoice", "option 1"); // add an item to the Choice
gui.addItem("myChoice", "option 2"); // add an item to the Choice
gui.selectItem("myChoice", "option 1"); // select the first item in the Choice
}
|
Description
|
Creates a Choice element. A Choice is a drop-down box that enables the user to choose between several items that you add to it. Only one item can be selected at a time.
|
Syntax
|
gui.addChoice(name, x, y, width, height);
|
Parameters
|
String name
|
The name of the element. You can query and change the element's attributes later on by referring to this name.
|
int x, int y
|
The x and y coordinates of the element's top left point.
|
int width, int height
|
The size of the element. Note that Choice sizes are largely determined by the operating system, so the values you pass in these parameters are not necessarily the exact resulting size.
|
|
Returns
|
nothing
|
Related
|
addItem()
removeItem()
hasItem()
getItemCount()
getItemByIndex()
getSelectedItem()
selectItem()
addList()
table of events
|
back to the top of the page
|
| |
| | |