On build, I fail with this: 'ofAddListener': none of the 5 overloads could convert all the argument types (compiling source file ofApp.cpp)
it originates from:
openFrameworks\types\ofParameter.h line 435
I have no idea what I’m doing wrong. I tried explicitly giving the priority and switching the bool function to a void function, but it doesn’t make any difference.
Have a closer look at the example provided, there you will see that ofParameter requires a type, and that type has to be passed as parameter to the listener function.
In your case, i would try something like that:
I think I messed up with the formatting on the site, because I had a <bool> after the ofParameter so it was like you said. I didn’t have the other one on the other hand, so I’ll try it right away. Do I need to give it a bool or void return value?
the most common and what you usually want to use 90% of the times is the first one. for the rest:
const void* sender is a pointer to the original sender (in this case the ofParameter) that you ned to cast to the original type, if’s only useful if you have several events attached to the same listeners and want to know where they are comming from but it’s usually better to do this some other way
the bool return type can be used to mark an event as attended avoiding it to propagate to any more listeners if you return true from that function.