Class: Wx::TimerEvent

Inherits:
Event show all
Defined in:
lib/wx/doc/gen/timer_event.rb

Overview

TimerEvent object is passed to the event handler of timer events (see Wx::Timer#set_owner).

For example:

class MyFrame < Wx::Frame

    def initialize
      super(nil)
      @timer = Wx::Timer.new(self, TIMER_ID)

      evt_timer(TIMER_ID, :on_timer)

      @timer.start(1000)    # 1 second interval
    end
     
    ...
     
    def on_timer(event)
      # do whatever you want to do every second here
    end
  
  end

Category: Events

See Also:

Requires:

  • USE_TIMER

Instance Method Summary collapse

Methods inherited from Event

#clone, #get_event_category, #get_event_object, #get_event_type, #get_id, #get_skipped, #get_timestamp, #is_command_event, #resume_propagation, #set_event_object, #set_event_type, #set_id, #set_timestamp, #should_propagate, #skip, #stop_propagation

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(timer) ⇒ Wx::TimerEvent

Parameters:



53
# File 'lib/wx/doc/gen/timer_event.rb', line 53

def initialize(timer) end

Instance Method Details

#get_intervalInteger Also known as: interval

Returns the interval of the timer which generated this event.

Returns:

  • (Integer)


57
# File 'lib/wx/doc/gen/timer_event.rb', line 57

def get_interval; end

#get_timerWx::Timer Also known as: timer

Returns the timer object which generated this event.

Returns:



62
# File 'lib/wx/doc/gen/timer_event.rb', line 62

def get_timer; end