Hi All,
I tried to make an sketch with some ControlP5 elements (knobs and radio buttons).
Idea is to based on the selected radio button, change specific value with knob.
This I got working.
the harder part is when i change radio button, i would like to set knob to specific (current) value. For that I need to pass event from radio button. However I cannot get this working in python mode.
I took the java example (it is working) and stripped it from what i think is not needed. See the code below.
However I cannot make it work - none of the three controlEvents prints a thing to the console.
What am I doing wrong ?
Any help will be appreciated
Regards
Matt
add_library('controlP5')
def setup():
size(700,400)
cp5 = ControlP5(this)
r = cp5.addRadioButton("radioButton")
r.setPosition(20,160)
r.setSize(40,20)
r.setSpacingRow(50)
r.addItem("50",1)
r.addItem("100",2)
def draw():
background(0)
pass
def controlEvent(theEvent):
print("got an event from r")
# def controlEvent(theEvent):
# if theEvent.isFrom(r):
# print("got an event from r")
# def controlEvent(theEvent):
# if (theEvent.isGroup() and theEvent.name().equals("radioButton")):
# print(theEvent.arrayValue())