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 = nil, &block) ⇒ Object
- #add_button_release_hook(hook = nil, &block) ⇒ Object
- #add_motion_notify_hook(hook = nil, &block) ⇒ Object
- #add_scroll_hook(hook = nil, &block) ⇒ 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 = nil, &block) ⇒ Object
32 33 34 35 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 32 def (hook=nil, &block) hook ||= Proc.new(&block) @button_press_hook_procs << hook end |
#add_button_release_hook(hook = nil, &block) ⇒ Object
41 42 43 44 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 41 def (hook=nil, &block) hook ||= Proc.new(&block) @button_release_hook_procs << hook end |
#add_motion_notify_hook(hook = nil, &block) ⇒ Object
14 15 16 17 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 14 def add_motion_notify_hook(hook=nil, &block) hook ||= Proc.new(&block) @motion_notify_hook_procs << hook end |
#add_scroll_hook(hook = nil, &block) ⇒ Object
23 24 25 26 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 23 def add_scroll_hook(hook=nil, &block) hook ||= Proc.new(&block) @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
37 38 39 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 37 def @button_press_hook_procs.clear end |
#clear_button_release_hook ⇒ Object
46 47 48 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 46 def @button_release_hook_procs.clear end |
#clear_hooks ⇒ Object
50 51 52 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 50 def clear_hooks init_hook_handler end |
#clear_motion_notify_hook ⇒ Object
19 20 21 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 19 def clear_motion_notify_hook @motion_notify_hook_procs.clear end |
#clear_scroll_hook ⇒ Object
28 29 30 |
# File 'lib/rabbit/renderer/display/hook-handler.rb', line 28 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 |