You can continue the above code with some thing like this
Code:
class myfrm: public wxFrame
(
public: myfrm();
private:
void otm(wxTimerEvent &); / / processing of the event
private: wxTimer mtim; / / Timer
private: DECLARE_EVENT_TABLE()
); BEGIN_EVENT_TABLE(myfrm, wxFrame)
EVT_TIMER(wany, otm) / / Add the event to the event table
END_EVENT_TABLE()
myfrm::myfrm(const wxString & title)
: wxFrame(NULL, wany, WXT("Timer Sample"))
, mtim(this) / / we tell the timer that should generate an event to this window
(
mtim.Start(2000); / / we started
)
void myfrm::otm(wxTimerEvent &)
(
/ / just do it!
)
Bookmarks