Methods
#
A
B
C
D
E
I
L
M
N
O
P
R
S
T
V
Constants
TkCommandNames = ['::blt::vector'.freeze].freeze
 
Class Public methods
create(*args)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 13
def self.create(*args)
  tk_call('::blt::vector', 'create', *args)
end
destroy(*args)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 17
def self.destroy(*args)
  tk_call('::blt::vector', 'destroy', *args)
end
expr(expression)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 21
def self.expr(expression)
  tk_call('::blt::vector', 'expr', expression)
end
names(pat=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 25
def self.names(pat=None)
  list = simplelist(tk_call('::blt::vector', 'names', pat))
  TkVar_ID_TBL.mutex.synchronize{
    list.collect{|name|
      if TkVar_ID_TBL[name]
        TkVar_ID_TBL[name]
      elsif name[0..1] == '::' && TkVar_ID_TBL[name[2..-1]]
        TkVar_ID_TBL[name[2..-1]]
      else
        name
      end
    }
  }
end
new(size=nil, keys={})
# File ext/tk/lib/tkextlib/blt/vector.rb, line 42
def initialize(size=nil, keys={})
  if size.kind_of?(Hash)
    keys = size
    size = nil
  end
  if size.kind_of?(Array)
    # [first, last]
    size = size.join(':')
  end
  if size
    @id = TkCore::INTERP._invoke('::blt::vector', 'create',
                                 "#auto(#{size})", *hash_kv(keys))
  else
    @id = TkCore::INTERP._invoke('::blt::vector', 'create',
                                 "#auto", *hash_kv(keys))
  end

  TkVar_ID_TBL.mutex.synchronize{
    TkVar_ID_TBL[@id] = self
  }

  @def_default = false
  @default_val = nil

  @trace_var  = nil
  @trace_elem = nil
  @trace_opts = nil

  # teach Tk-ip that @id is global var
  TkCore::INTERP._invoke_without_enc('global', @id)
end
Instance Public methods
*(item)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 86
def *(item)
  list(tk_call(@id, '*', item))
end
+(item)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 90
def +(item)
  list(tk_call(@id, '+', item))
end
-(item)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 94
def -(item)
  list(tk_call(@id, '-', item))
end
/(item)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 98
def /(item)
  list(tk_call(@id, '/', item))
end
[](idx)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 140
def [](idx)
  index(idx)
end
[]=(idx, val)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 144
def []=(idx, val)
  index(idx, val)
end
append(*vectors)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 102
def append(*vectors)
  tk_call(@id, 'append', *vectors)
end
binread(channel, len=None, keys={})
# File ext/tk/lib/tkextlib/blt/vector.rb, line 106
def binread(channel, len=None, keys={})
  if len.kind_of?(Hash)
    keys = len
    len = None
  end
  keys = _symbolkey2str(keys)
  keys['swap'] = None if keys.delete('swap')
  tk_call(@id, 'binread', channel, len, keys)
end
clear()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 116
def clear()
  tk_call(@id, 'clear')
  self
end
delete(*indices)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 121
def delete(*indices)
  tk_call(@id, 'delete', *indices)
  self
end
destroy()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 74
def destroy
  tk_call('::blt::vector', 'destroy', @id)
end
dup_vector(vec)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 126
def dup_vector(vec)
  tk_call(@id, 'dup', vec)
  self
end
expr(expression)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 131
def expr(expression)
  tk_call(@id, 'expr', expression)
  self
end
index(idx, val=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 136
def index(idx, val=None)
  number(tk_call(@id, 'index', idx, val))
end
inspect()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 78
def inspect
  '#<Tk::BLT::Vector: ' + @id + '>'
end
length()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 148
def length()
  number(tk_call(@id, 'length'))
end
length=(size)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 152
def length=(size)
  number(tk_call(@id, 'length', size))
end
merge(*vectors)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 156
def merge(*vectors)
  tk_call(@id, 'merge', *vectors)
  self
end
normalize(vec=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 161
def normalize(vec=None)
  tk_call(@id, 'normalize', vec)
  self
end
notify(keyword)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 166
def notify(keyword)
  tk_call(@id, 'notify', keyword)
  self
end
offset()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 171
def offset()
  number(tk_call(@id, 'offset'))
end
offset=(val)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 175
def offset=(val)
  number(tk_call(@id, 'offset', val))
end
populate(vector, density=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 183
def populate(vector, density=None)
  tk_call(@id, 'populate', vector, density)
  self
end
random()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 179
def random()
  tk_call(@id, 'random')
end
range(first, last=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 188
def range(first, last=None)
  list(tk_call(@id, 'range', first, last))
end
# File ext/tk/lib/tkextlib/blt/vector.rb, line 192
def search(val1, val2=None)
  list(tk_call(@id, 'search', val1, val2))
end
seq(start, finish=None, step=None)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 201
def seq(start, finish=None, step=None)
  tk_call(@id, 'seq', start, finish, step)
  self
end
set(item)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 196
def set(item)
  tk_call(@id, 'set', item)
  self
end
sort(*vectors)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 206
def sort(*vectors)
  tk_call(@id, 'sort', *vectors)
  self
end
sort_reverse(*vectors)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 211
def sort_reverse(*vectors)
  tk_call(@id, 'sort', '-reverse', *vectors)
  self
end
split(*vectors)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 216
def split(*vectors)
  tk_call(@id, 'split', *vectors)
  self
end
to_s()
# File ext/tk/lib/tkextlib/blt/vector.rb, line 82
def to_s
  @id
end
variable(var)
# File ext/tk/lib/tkextlib/blt/vector.rb, line 221
def variable(var)
  tk_call(@id, 'variable', var)
  self
end