View Full Version : indentifyng if a callback actualy is active

03 March 2009, 12:07 AM

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?


03 March 2009, 01:02 AM
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 :D

03 March 2009, 03:07 AM
For what it's worth, there's no easy way to check.

You could call, 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.

03 March 2009, 08:43 PM
thanks for the answer it was useful :)

CGTalk Moderation
03 March 2009, 08:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.