PDA

View Full Version : indentifyng if a callback actualy is active


CerberusC
02-28-2009, 11:07 PM
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!

CerberusC
03-01-2009, 12: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

ZeBoxx2
03-01-2009, 02:07 AM
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.

CerberusC
03-03-2009, 07:43 PM
thanks for the answer it was useful :)

CGTalk Moderation
03-03-2009, 07: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.