module Rabbit::Renderer::Display::HookHandler
Public Class Methods
new(*args, &block)
click to toggle source
Calls superclass method
# File lib/rabbit/renderer/display/hook-handler.rb, line 5 def initialize(*args, &block) super init_hook_handler end
Public Instance Methods
add_motion_notify_hook(hook=Proc.new)
click to toggle source
# 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)
click to toggle source
# 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)
click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 10 def call_hook_procs(procs, *args) procs.any? {|proc| proc.call(*args)} end
clear_hooks()
click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 46 def clear_hooks init_hook_handler end
clear_motion_notify_hook()
click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 18 def clear_motion_notify_hook @motion_notify_hook_procs.clear end
clear_scroll_hook()
click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 26 def clear_scroll_hook @scroll_hook_procs.clear end
Private Instance Methods
init_hook_handler()
click to toggle source
# File lib/rabbit/renderer/display/hook-handler.rb, line 51 def init_hook_handler @motion_notify_hook_procs = [] @scroll_hook_procs = [] @button_press_hook_procs = [] @button_release_hook_procs = [] end