We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › controlp5 buttons
Page Index Toggle Pages: 1
controlp5 buttons (Read 539 times)
controlp5 buttons
Feb 28th, 2008, 5:33pm
 
unfortunately i dont exactly understand how to control the click method for a button.

i have a class with a unique id and some buttons, that r named after the unique id:
Quote:
controlP5.addButton(ID+" set start",0,0,0,60,20);

i can change the position(
Quote:
controlP5.controller(ID+" set start").setPosition(x+30,y+90);

and so on, but how is it possible to catch click events?

am i right that there's no possibility to create controlP5 button arrays?
how could i solve this problem with the controlP5 setId() method?
Re: controlp5 buttons
Reply #1 - Feb 29th, 2008, 11:37am
 
Use the controlEvent() method to catch click events, as shown in the example provided with the library.

Code:
void controlEvent(ControlEvent theEvent) {
println(theEvent.controller().name());
}


Quote:
am i right that there's no possibility to create controlP5 button arrays?

why not?
controlP5.Button[] buttons;
Page Index Toggle Pages: 1