Method: TkTextWindow#configure

Defined in:
lib/tk/textwindow.rb

#configure(slot, value = None) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/tk/textwindow.rb', line 80

def configure(slot, value=None)
  if slot.kind_of?(Hash)
    slot = _symbolkey2str(slot)
    if slot['window']
      @id = slot['window']
      # slot['window'] = @id.epath if @id.kind_of?(TkWindow)
      slot['window'] = _epath(@id) if @id
    end
    if slot['create']
      self.create=slot.delete('create')
    end
    if slot.size > 0
      tk_call_without_enc(@t.path, 'window', 'configure', @index,
                          *hash_kv(slot, true))
    end
  else
    if slot == 'window' || slot == :window
      @id = value
      # value = @id.epath if @id.kind_of?(TkWindow)
      value = _epath(@id) if @id
    end
    if slot == 'create' || slot == :create
      self.create=value
    else
      tk_call_without_enc(@t.path, 'window', 'configure', @index,
                          "-#{slot}", _get_eval_enc_str(value))
    end
  end
  self
end