lib/ffi-tk/command/bind.rb in ffi-tk-2010.01 vs lib/ffi-tk/command/bind.rb in ffi-tk-2010.01.02

- old
+ new

@@ -1,28 +1,11 @@ module Tk module Bind - def self.bind(tag, sequence = None) - if None == sequence - Tk.execute(:bind, tag).to_a - else - if block_given? - Event::Handler.register(tag, sequence, &Proc.new) - else - Tk.execute(:bind, tag, sequence).to_s - end - end + def self.bind(pathname, sequence, &block) + Event::Handler.register(pathname, sequence, &block) end - # TODO: remove the block associated - def self.unbind(tag, sequence) - Event::Handler.unregister(tag, sequence) - end - - def bind(sequence = None, &block) + def bind(sequence, &block) Bind.bind(tk_pathname, sequence, &block) end - - def unbind(sequence) - Bind.unbind(tk_pathname, sequence) - end end -end +end \ No newline at end of file