Closed GoogleCodeExporter closed 8 years ago
ok noted and reproduced, reflection mistake.
Original comment by soj...@gmail.com
on 23 Apr 2012 at 1:13
The example code misses a method called 'radioButton', which is the name given
in line 25:
r = cp5.addRadioButton("radioButton")
just add these lines to the code:
void radioButton(int i) {
myColorBackground = color(i * 50,0,0);
}
then, you can also remove the last statement in the controlEvent() method.
hth
Original comment by spgschm...@gmail.com
on 3 May 2012 at 2:24
spgschm: Yes, but named callback methods should be optional.
Original comment by ericm...@localprojects.com
on 3 May 2012 at 2:26
probably, however, it is not:
http://code.google.com/p/controlp5/source/browse/trunk/src/controlP5/RadioButton
.java#477
Original comment by spgschm...@gmail.com
on 3 May 2012 at 4:11
Yes indeed, I just wanted to clarify the user's expectation based on past
releases of ControlP5 (which did not require user-defined named callback
methods).
Given ControlP5's minimal-config philosophy, this new behavior is probably a
mistake?
Original comment by ericm...@localprojects.com
on 3 May 2012 at 4:16
Yes, it's a bit confusing. On the one hand, the doc says:
"radioButton is of type ControllerGroup, therefore a controllerPlug can't be set. this means that an event from a radioButton can't be forwarded to a method other than controlEvent in a sketch."
On the other hand, there are these methods:
public RadioButton plugTo(Object theObject)
public RadioButton plugTo(Object theObject, String thePlugName)
and the abovementioned reflection mechanism.
I'm new to controlP5, so I can't tell how it is supposed to be.
Original comment by spgschm...@gmail.com
on 3 May 2012 at 4:30
[deleted comment]
comment 5, ericmika is right here. Its a mistake which will be fixed in the
next release.
Controllergroups dont have ControllerPlug callbacks but I made an exception for
radiobutton and checkbox which also resulted in the discussed mistake.
Original comment by soj...@gmail.com
on 15 May 2012 at 12:14
Original comment by soj...@gmail.com
on 18 May 2012 at 5:13
Thanks! Do you know where we can find the patched code? Looks like the latest
revision on this site is r60 from april, which predates this fix.
Original comment by ericm...@localprojects.com
on 20 May 2012 at 9:46
Original issue reported on code.google.com by
amnonp5@gmail.com
on 22 Apr 2012 at 7:42