What is the best way to pass a callback return value from an addon to ofApp.cpp?

I found some resources in the forum, but nothing that I really understand…

What I want to do: Send a callback for blur or focus from ofxAppEmscriptenWindow.cpp to ofApp.cpp.
I would really appreciate some hints.

Please refer to the link above. What you probably need to do is:
get ofApp pointer → get glfw window → set custom function for callback with glfw method.

@mcpcseal thank you. The blur / focus callback in the addon already works. My problem is, how to pass it from the addon to ofApp.cpp. In a simple case that works, too: OF-GUI-library/bang.cpp at main · Jonathhhan/OF-GUI-library · GitHub
There are two problems in this case, whether it is not possible to pass a static functions (which this callback is) with notify. Or the callback does not belong to the scope (if I want to pass a different callback from ofxEmscriptenSoundStream, which belongs to ofSoundStream for example). I will have a look for the exact error messages…

Using this public method to get events and check if targeting condition is met in update() could be an alternative solution.

There could be many solution to get same results, so please don’t mind about posting your final goal of implementation.

1 Like

Thank you, of course I will do that.