glutTimerFunc......how to ignore it

I dunno how to ignore the glutTimerFunc callback in my code, I know you cant stop the callback once u start it, but I am not sure how to ignore it. Here’s what my code does basically:

the main window has teapots, and i have a glui window with spinners, translations, listboxes and all. I have a listbox with these 3 options:
“None”
“glutTimerFun”
“glutIdleFunc”

So depending on what the user chooses of the 3, the animation should be either accordin to glutTimerFunc, or gludIdlefunc or no animation at all. I have a Timer(int value) function like this:
void timer(int value)
{
if(value)
rotation++;
glutPostRedisplay();
glutTimerFunc(100,timer,1);
}

and when a user chooses “gluTimerFunc” option from the listbox, it calls on this timer function, which then calls itself recursively every 100ms. What should do I to make it point elsewhere when the user chooses “None” or the “glutIdleFunc” options from the listbox.
Any help will be much appreciated.

I should have searched on this topic before creating this thread, sorry :slight_smile: