#include </home/zeitlin/src/wx/github/interface/wx/timer.h>
wxTimerEvent object is passed to the event handler of timer events (see wxTimer::SetOwner).
以下に例を示します:
class MyFrame : public wxFrame { public: ... void OnTimer(wxTimerEvent& event); private: wxTimer m_timer; wxDECLARE_EVENT_TABLE(); }; wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_TIMER(TIMER_ID, MyFrame::OnTimer) wxEND_EVENT_TABLE() MyFrame::MyFrame() : m_timer(this, TIMER_ID) { m_timer.Start(1000); // 1 second interval } void MyFrame::OnTimer(wxTimerEvent& event) { // do whatever you want to do every second here }
Public Member Functions | |
wxTimerEvent () | |
wxTimerEvent (wxTimer &timer) | |
int | GetInterval () const |
Returns the interval of the timer which generated this event. | |
wxTimer & | GetTimer () const |
Returns the timer object which generated this event. |
wxTimerEvent::wxTimerEvent | ( | ) |
wxTimerEvent::wxTimerEvent | ( | wxTimer & | timer | ) |
int wxTimerEvent::GetInterval | ( | ) | const |
Returns the interval of the timer which generated this event.
wxTimer& wxTimerEvent::GetTimer | ( | ) | const |
Returns the timer object which generated this event.