Updating Scene on EVE window at regular interval

Hello Experts,
I am struggling with how to update scene at regular interval on Eve window
I have tried using sleep inside a for loop,

While(true){
sleep(1);
UpdateFunction();
}

Basically what i wanted to do is at regular interval i want to update some paremeter of my
geometry and then want to update the scene.

if i use sleep then the window become unresponsive.

I realized that i cannot use sleep here because it freeze the program for specified time.

So is there any function available in EVE that allow me to call some update function at specified time
interval.

Regards,
Raman

Hi,

You have to call gSystem->ProcessEvents() on a regular basis, to let the system handle GUI (among other) events. So you could do something like:

   while (true) {
      gSystem->Sleep(20);
      gSystem->ProcessEvents();
      gEve->Redraw3D(kTRUE);
   }

And if you simply want to redraw on a regular interval, you can also use a Timer. E.g.:

TTimer timer(1000); // every second timer.SetCommand("gEve->Redraw3D(kTRUE);"); timer.TurnOn(); N.B. Without while loop!

Cheers, Bertrand.

Thanks Bertrand.