Sha256: 59181b9e477b9fa54f82400cd19b6f99439c9d70a8cb1dd153b030bab0a902f3

Contents?: true

Size: 622 Bytes

Versions: 6

Compression:

Stored size: 622 Bytes

Contents

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
    end

    # TODO: remove the block associated
    def self.unbind(tag, sequence)
      Event::Handler.unregister(tag, sequence)
    end

    def bind(sequence = None, &block)
      Bind.bind(tk_pathname, sequence, &block)
    end

    def unbind(sequence)
      Bind.unbind(tk_pathname, sequence)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffi-tk-2010.08.23 lib/ffi-tk/command/bind.rb
ffi-tk-2010.08 lib/ffi-tk/command/bind.rb
ffi-tk-2010.06 lib/ffi-tk/command/bind.rb
ffi-tk-2010.03 lib/ffi-tk/command/bind.rb
ffi-tk-2010.02 lib/ffi-tk/command/bind.rb
ffi-tk-2010.01 lib/ffi-tk/command/bind.rb