Module: WxExtensions::EventBinder

Defined in:
lib/reactive-wx/wx_ext/event_binder.rb

Overview

Adds a cooked way of connecting events to handler. Will be injected into Wx::EvtHandler

Instance Method Summary collapse

Instance Method Details

#cooked_connect(event_name, window_or_id, meth = nil, &block) ⇒ Object



5
6
7
8
9
# File 'lib/reactive-wx/wx_ext/event_binder.rb', line 5

def cooked_connect(event_name, window_or_id, meth = nil, &block)
  handler = acquire_handler(meth, block)
  id  = acquire_id(window_or_id)
  connect(id, Wx::ID_ANY, self.class.event_type_for_name("evt_#{event_name}".to_sym), &handler)
end