Module: Rabbit::Renderer::Display::HookHandler
- Included in:
- InfoWindow, Base
- Defined in:
- lib/rabbit/renderer/display/hook-handler.rb
Instance Method Summary collapse
- #add_button_press_hook(hook = Proc.new) ⇒ Object
- #add_button_release_hook(hook = Proc.new) ⇒ Object
- #add_motion_notify_hook(hook = Proc.new) ⇒ Object
- #add_scroll_hook(hook = Proc.new) ⇒ Object
- #call_hook_procs(procs, *args) ⇒ Object
- #clear_button_press_hook ⇒ Object
- #clear_button_release_hook ⇒ Object
- #clear_hooks ⇒ Object
- #clear_motion_notify_hook ⇒ Object
- #clear_scroll_hook ⇒ Object
- #initialize(*args, &block) ⇒ Object
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 (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 (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_hook ⇒ Object
34 35 36 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 34 def @button_press_hook_procs.clear end |
#clear_button_release_hook ⇒ Object
42 43 44 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 42 def @button_release_hook_procs.clear end |
#clear_hooks ⇒ Object
46 47 48 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 46 def clear_hooks init_hook_handler end |
#clear_motion_notify_hook ⇒ Object
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_hook ⇒ Object
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 |