wxTimerEvent Class Reference
[Events]

#include <wx/timer.h>

Inheritance diagram for wxTimerEvent:
Inheritance graph
[legend]

Detailed Description

wxTimerEvent object is passed to the event handler of timer events (see wxTimer::SetOwner).

For example:

    class MyFrame : public wxFrame
    {
    public:
        ...
        void OnTimer(wxTimerEvent& event);

    private:
        wxTimer m_timer;
    };

    BEGIN_EVENT_TABLE(MyFrame, wxFrame)
        EVT_TIMER(TIMER_ID, MyFrame::OnTimer)
    END_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
    }

Library:  wxBase
Category:  Events
See also:
wxTimer

Public Member Functions

int GetInterval () const
 Returns the interval of the timer which generated this event.
wxTimerGetTimer () const
 Returns the timer object which generated this event.

List of all members.


Member Function Documentation

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.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



wxWidgets logo

[ top ]