Class: Wx::TimerEvent
- 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
Instance Method Summary collapse
-
#get_interval ⇒ Integer
(also: #interval)
Returns the interval of the timer which generated this event.
-
#get_timer ⇒ Wx::Timer
(also: #timer)
Returns the timer object which generated this event.
- #initialize(timer) ⇒ Wx::TimerEvent constructor
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
53 |
# File 'lib/wx/doc/gen/timer_event.rb', line 53 def initialize(timer) end |
Instance Method Details
#get_interval ⇒ Integer Also known as: interval
Returns the interval of the timer which generated this event.
57 |
# File 'lib/wx/doc/gen/timer_event.rb', line 57 def get_interval; end |
#get_timer ⇒ Wx::Timer Also known as: timer
Returns the timer object which generated this event.
62 |
# File 'lib/wx/doc/gen/timer_event.rb', line 62 def get_timer; end |