Class: UI::MouseSectionEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/ektoplayer/ui.rb

Instance Method Summary collapse

Constructor Details

#initialize(start = nil, stop = nil) ⇒ MouseSectionEvent

Returns a new instance of MouseSectionEvent.



278
279
280
# File 'lib/ektoplayer/ui.rb', line 278

def initialize(start=nil, stop=nil)
   @start_pos, @stop_pos, @events = start, stop, MouseEvents.new
end

Instance Method Details

#on(button, &block) ⇒ Object



282
# File 'lib/ektoplayer/ui.rb', line 282

def on(button, &block); @events.on(button, &block)  end

#trigger(mevent) ⇒ Object



284
285
286
287
# File 'lib/ektoplayer/ui.rb', line 284

def trigger(mevent)
   return unless mevent.pos >= @start_pos and mevent.pos <= @stop_pos
   @events.trigger(mevent)
end