[Closed] indentifyng if a callback actualy is active
Hi.
I have a problem, i have a timer to reactivate a callback after it has been deactivated, but i don’t need this.
I need to identify if the callback is active, because the timer is redoiong the action that the callback must do every second, so i want to put an if function that prints a “say hello to daddy” if the callback is active and if the callback is not active it will activate it.
Can someone help me?
Cheers!
not neccesary anymore, i put a variable and change it when the function is activated, so with the timer i change it again to on, and when the funciont is executed again it is disabled again.
Cheers
For what it’s worth, there’s no easy way to check.
You could call callbacks.show(), grab the Listener windowstream, convert to a stringstream, parse it, and work with that – but that’s not going to work in network rendering and such, I think.
Best bet is to remove it when you’re not using it and adding it when you will be.
In your specific case, where you just need to enable/disable the callback’s actual code (the callback still remains, but no code (beyond an if-then-else) is executed), a variable is indeed the way to go.