Module: WindowBlessing::Evented

Included in:
EventedVariable, Widgets::Slider, Window
Defined in:
lib/window_blessing/evented.rb

Instance Method Summary collapse

Instance Method Details

#event_managerObject



3
4
5
# File 'lib/window_blessing/evented.rb', line 3

def event_manager
  @event_manager ||= EventManager.new(self)
end

#handle_event(event) ⇒ Object



13
14
15
16
# File 'lib/window_blessing/evented.rb', line 13

def handle_event(event)
  event[:object] = self
  event_manager.handle_event(event)
end

#on(*args, &block) ⇒ Object

define event handler



8
9
10
11
# File 'lib/window_blessing/evented.rb', line 8

def on(*args,&block)
  event_manager.on *args, &block
  self
end