Eric F. wrote on Jan 14th, 2009, 6:07am:cool. it would be nice at some point to have these functions in the documentation. if they are there, i couldn't find them.
you are right, they arent there. needs to be added under the Controller documentation.
Eric F. wrote on Jan 14th, 2009, 6:07am:one question - how do you do this with a Button, since you can't use the object type Button as processing throws an error - "type Button is ambiguous"
use
Code:
controlP5.Button b = controlP5.addButton("Go",0,50,50,20,20);
b.setCaptionLabel("Go do that thing");
controlP5 here is the name of the package.
with version 0.3.7 use b.setCaptionLabel("text") instead of b.captionLabel().set("text"), there is an issue with cutting off a label with the latter.
Eric F. wrote on Jan 14th, 2009, 6:07am:also, can you clear up what the first parameter after the name in the Button constructor is for
this parameter is the value of a button and can be accessed e.g. in controlEvent like this:
Code:
void controlEvent(ControlEvent theEvent) {
println(theEvent.controller().value());
}