Module: Rabbit::Renderer::Display::HookHandler

Included in:
InfoWindow, Base
Defined in:
lib/rabbit/renderer/display/hook-handler.rb

Instance Method Summary collapse

Instance Method Details

#add_button_press_hook(hook = Proc.new) ⇒ Object



30
31
32
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 30

def add_button_press_hook(hook=Proc.new)
  @button_press_hook_procs << hook
end

#add_button_release_hook(hook = Proc.new) ⇒ Object



38
39
40
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 38

def add_button_release_hook(hook=Proc.new)
  @button_release_hook_procs << hook
end

#add_motion_notify_hook(hook = Proc.new) ⇒ Object



14
15
16
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 14

def add_motion_notify_hook(hook=Proc.new)
  @motion_notify_hook_procs << hook
end

#add_scroll_hook(hook = Proc.new) ⇒ Object



22
23
24
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 22

def add_scroll_hook(hook=Proc.new)
  @scroll_hook_procs << hook
end

#call_hook_procs(procs, *args) ⇒ Object



10
11
12
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 10

def call_hook_procs(procs, *args)
  procs.any? {|proc| proc.call(*args)}
end

#clear_button_press_hookObject



34
35
36
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 34

def clear_button_press_hook
  @button_press_hook_procs.clear
end

#clear_button_release_hookObject



42
43
44
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 42

def clear_button_release_hook
  @button_release_hook_procs.clear
end

#clear_hooksObject



46
47
48
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 46

def clear_hooks
  init_hook_handler
end

#clear_motion_notify_hookObject



18
19
20
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 18

def clear_motion_notify_hook
  @motion_notify_hook_procs.clear
end

#clear_scroll_hookObject



26
27
28
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 26

def clear_scroll_hook
  @scroll_hook_procs.clear
end

#initialize(*args, &block) ⇒ Object



5
6
7
8
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 5

def initialize(*args, &block)
  super
  init_hook_handler
end