wxTimer

wxTimer
Creation Parameters
The parent is important, as this is the only way to receive wxTimer events.

The id is also important, especially if you plan to have more than one wxTimer, because timer events can only be distinguished by their id.

To set a timer event handler, use wxEVT_TIMER:

Example:


    constant
    main = create( wxFrame, {0,-1,"Timer"} ),
    timer_id = new_id(),
    timer = create( wxTimer, {main, timer_id} )

    procedure on_timer( atom this, atom event_type, atom id, atom event )
        puts(1,"Timer\n")
    end procedure

    -- NOTE: using the parent and the id to identify the timer.
    set_event_handler( main, timer_id, wxEVT_TIMER, routine_id("on_timer"))

    -- set the timer to fire every 1 second, repeatedly
    start_timer( timer, 1000, 0 )

    wxMain( main )

Functions/Procedures
Supertopics

wxTimer

[proc]
start_timer
( atom timer, atom msec, integer oneshot )

Category: wxTimer

Set the timer to fire every msec millisecond ( 1000msec = 1sec ). oneshot indicates whether the timer should stop firing after the first time, or fire repeatedly until stop_timer() is called.


wxTimer

[proc]
stop_timer
( atom timer )

Category: wxTimer

Stops a timer from firing until reset using start_timer().