Table of Contents

wxTimer

include file: wxTimer


Creation parameters: The parent is important, as this is the only way to receive wxTimer events. To set a timer event handler, use wxEVT_TIMER:
ex:

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

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

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

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

wxMain( main )

  • proc start_timer( atom timer, atom msec, integer oneshot )   
  • proc stop_timer( atom timer )     
     
    Parent Topics:
  • Classes
  • Events
  • Timers


    Table of Contents

    [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.

    See Also: stop_timer



    Table of Contents

    [proc]
    stop_timer
    ( atom timer )

    Category: wxTimer

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

    See Also: start_timer