Just a question here. Do you really want to store multiple times a variable and automte updates on change? updating could lead to an endless cyclic feedback… isn’t possible in your application to have one single storage and get a pointer to it in as many objects as you want?
this could work if we allowed listeners that got a parameter by value but we don’t have support for that syntax yet. I’ve thought about this some times but never get to really add it. Probably for next version.
I would like to make links between objects at runtime. Something like the AE pick whip tool.
This way one objects parameter could control parameters of another object. Think of „Animated x-value of A changes transparency of B“.
I am not very familiar with Lambda functions so please excuse if I don’t understand above statement ceompletely.
I get two errors
ofApp.cpp:19:58: 'this' cannot be implicitly captured in this context
ofParameter.h:434:7: Candidate function template not viable: requires at least 2 arguments, but 1 was provided
I guess the latter refers to the definition of ofParameter::addListener which excpects not only a callback function but also a class it should invoke it on.
The first I don’t quite understand. maybe it complains because the Lambda function doesn’t have test3 in it’s scope?!
Error:(153, 18) no matching member function for call to ‘addListener’
This other way (same than gui examples) is working but I am not sure can be problematic in some way. (Maybe i’ll need a bool to disable the listener when color_randomized -> color_picked, and use another listener.)
The problem is that you use .addListener method, and you should be using .newListener method, also you have to save the listener into a variable, see last post of Arturo in this thread, or this blog post about new event system in OF0.10: https://blog.openframeworks.cc/post/173223240829/events