Module: WindowBlessing::Widgets::DraggableBackground

Defined in:
lib/window_blessing/widgets/draggable_background.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args) ⇒ Object



5
6
7
8
9
# File 'lib/window_blessing/widgets/draggable_background.rb', line 5

def initialize(*args)
  super *args
  on :pointer, :button_down  do |event| @mouse_offset = event[:loc] end
  on :pointer, :drag         do |event| self.loc += event[:loc] - @mouse_offset end
end