sojamo / controlp5

A gui library for processing.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

All my buttons press themselves once on startup

JacksonRFilms opened this issue · comments

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)
;

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