Module: Tk::Bind

Included in:
Widget
Defined in:
lib/ffi-tk/command/bind.rb

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Object) bind(tag, sequence = None)



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ffi-tk/command/bind.rb', line 3

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

+ (Object) unbind(tag, sequence)

TODO: remove the block associated



16
17
18
# File 'lib/ffi-tk/command/bind.rb', line 16

def self.unbind(tag, sequence)
  Event::Handler.unregister(tag, sequence)
end

Instance Method Details

- (Object) bind(sequence = None, &block)



20
21
22
# File 'lib/ffi-tk/command/bind.rb', line 20

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

- (Object) unbind(sequence)



24
25
26
# File 'lib/ffi-tk/command/bind.rb', line 24

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