Class | Tk::BLT::Vector |
In: |
tk/lib/tkextlib/blt/vector.rb
|
Parent: | TkVariable |
TkCommandNames | = | ['::blt::vector'.freeze].freeze |
# File tk/lib/tkextlib/blt/vector.rb, line 13 def self.create(*args) tk_call('::blt::vector', 'create', *args) end
# File tk/lib/tkextlib/blt/vector.rb, line 17 def self.destroy(*args) tk_call('::blt::vector', 'destroy', *args) end
# File tk/lib/tkextlib/blt/vector.rb, line 21 def self.expr(expression) tk_call('::blt::vector', 'expr', expression) end
# File tk/lib/tkextlib/blt/vector.rb, line 25 def self.names(pat=None) simplelist(tk_call('::blt::vector', 'names', pat)).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
# File tk/lib/tkextlib/blt/vector.rb, line 39 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 = INTERP._invoke('::blt::vector', 'create', "#auto(#{size})", *hash_kv(keys)) else @id = INTERP._invoke('::blt::vector', 'create', "#auto", *hash_kv(keys)) end 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 INTERP._invoke_without_enc('global', @id) end
# File tk/lib/tkextlib/blt/vector.rb, line 97 def append(*vectors) tk_call(@id, 'append', *vectors) end
# File tk/lib/tkextlib/blt/vector.rb, line 101 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
# File tk/lib/tkextlib/blt/vector.rb, line 116 def delete(*indices) tk_call(@id, 'delete', *indices) self end
# File tk/lib/tkextlib/blt/vector.rb, line 69 def destroy tk_call('::blt::vector', 'destroy', @id) end
# File tk/lib/tkextlib/blt/vector.rb, line 121 def dup_vector(vec) tk_call(@id, 'dup', vec) self end
# File tk/lib/tkextlib/blt/vector.rb, line 126 def expr(expression) tk_call(@id, 'expr', expression) self end
# File tk/lib/tkextlib/blt/vector.rb, line 131 def index(idx, val=None) number(tk_call(@id, 'index', idx, val)) end
# File tk/lib/tkextlib/blt/vector.rb, line 147 def length=(size) number(tk_call(@id, 'length', size)) end
# File tk/lib/tkextlib/blt/vector.rb, line 151 def merge(*vectors) tk_call(@id, 'merge', *vectors) self end
# File tk/lib/tkextlib/blt/vector.rb, line 156 def normalize(vec=None) tk_call(@id, 'normalize', vec) self end
# File tk/lib/tkextlib/blt/vector.rb, line 161 def notify(keyword) tk_call(@id, 'notify', keyword) self end
# File tk/lib/tkextlib/blt/vector.rb, line 170 def offset=(val) number(tk_call(@id, 'offset', val)) end
# File tk/lib/tkextlib/blt/vector.rb, line 178 def populate(vector, density=None) tk_call(@id, 'populate', vector, density) self end
# File tk/lib/tkextlib/blt/vector.rb, line 183 def range(first, last=None) list(tk_call(@id, 'range', first, last)) end
# File tk/lib/tkextlib/blt/vector.rb, line 187 def search(val1, val2=None) list(tk_call(@id, 'search', val1, val2)) end
# File tk/lib/tkextlib/blt/vector.rb, line 196 def seq(start, finish=None, step=None) tk_call(@id, 'seq', start, finish, step) self end
# File tk/lib/tkextlib/blt/vector.rb, line 201 def sort(*vectors) tk_call(@id, 'sort', *vectors) self end
# File tk/lib/tkextlib/blt/vector.rb, line 206 def sort_reverse(*vectors) tk_call(@id, 'sort', '-reverse', *vectors) self end
# File tk/lib/tkextlib/blt/vector.rb, line 211 def split(*vectors) tk_call(@id, 'split', *vectors) self end