gordy43 / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

Listen method doesn't work when the controller is pluged to another object #84

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If we plug the controller to an object myObject containing a 'property' field 
and enable this controller to listen to changes of 'property' :

cp5 = new ControlP5(this)
cp5.addSlider("property").plugTo(myObject).listen(true);

We get : 

java.lang.NoSuchFieldException: separation
java.lang.NullPointerException
    at processing.mode.java.runner.Runner.findException(Runner.java:947)
    at processing.mode.java.runner.Runner.reportException(Runner.java:892)
    at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:818)
    at processing.mode.java.runner.Runner$2.run(Runner.java:707)

It seems the listen method is looking for a field named 'property' in the 
context controlP5 was created in, whereas it should now be looking for the 
field 'property' in myObject.

Original issue reported on code.google.com by ianis.la...@gmail.com on 6 Nov 2013 at 6:02