We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello,
trying to create a set of radio buttons. Works fine, except I can't find a way to select one of the radios to be on, or 1, or true, or all of these, by default. Here is the reduction of what I use so far:
import controlP5.*;
ControlP5 cp5;
void setup() {
size(600, 600);
background(0);
cp5 = new ControlP5(this);
cp5.addRadioButton("scaleRadio")
.setPosition(195, 285)
.setSize(30, 30)
.setItemsPerRow(4)
.setSpacingColumn(30)
.addItem("1000", 1000)
.addItem("500", 500)
.addItem("200", 200)
.addItem("100", 100)
;
}
void draw() {
background(0);
}
Any help appreciated!
Answers
Just look at the example(s) that come with the library. It's both in the code example itself and in the list of the controller methods that is printed beneath each example.
You can use: .activate(2) // where 2 is the number of the button you want to select
Thanks! Yeah I'm not reading very well... I'm coming to Java the wrong way. Like, I don't even know the name to the .doesSomething() bits. Hopefully the class I'll be going to in June will help me get a better grip on the handling of classes and methods.