sojamo / controlp5

A gui library for processing.org
GNU Lesser General Public License v2.1
490 stars 142 forks source link

All my buttons press themselves once on startup #169

Open JacksonRFilms opened 3 years ago

JacksonRFilms commented 3 years ago

I have some buttons in my sketch that perform functions like saving a frame, getting a new random seed, and one that cycles thru 5 different "render qualities" and saves each one as a frame. The problem is, as soon as I run the sketch, all the buttons immediately activate and call all of their functions without me pressing any of them! here is the code i used to create the buttons:

cp5.addButton("New_seed") .setValue(0) .setPosition(50, 100) .setSize(200, 19) ;

cp5.addButton("Save_frame") .setValue(0) .setPosition(50, 120) .setSize(200, 19) ;

cp5.addButton("Render_all") .setValue(0) .setPosition(50, 140) .setSize(200, 19) ;

eagleaspen commented 3 years ago

Try taking out the .setValue(0) line. I had the same problem and this fixed it