A:
A:
// Derive a simple timer class that allows a command window
// pointer to be passed in.
class myCmdWindow; // Whatever you command window class is
class myTimer : public vTimer
{
public: //---------------------------------------- public
myTimer(myCmdWindow* cw) { cmdw = cw; }
~myTimer() {}
virtual void TimerTick()
// Call the window's WindowCommand to respond to the timer
{cmdw->WindowCommand(appropriateID, appropriateID, C_Button);}
private: //--------------------------------------- private
myCmdWindow* cmdw;
};
// Then, in the command window
//================>>> myCmdWindow::myCmdWindow <<<================
myCmdWindow::myCmdWindow(char* name, int height, int width) :
vCmdWindow(name, height, width)
{
// Appropriate stuff to define window
// ...
// Now, create the timer to local myTimer _timer ptr.
_timer = new myTimer(this); // create timer
_timer->TimerSet(1000); // 1 second interval
// ....
}