Methods
- A
- C
- D
- E
- F
- G
- I
- K
- L
-
- label,
- label=,
- last_child,
- leaf?,
- link?
- M
- N
-
- new,
- new,
- next,
- next_sibling
- P
- R
- S
- T
- U
- V
Constants
TreeNodeID_TBL | = | TkCore::INTERP.create_table |
Class Public methods
id2obj(tree, id)
Link
# File ext/tk/lib/tkextlib/blt/tree.rb, line 22 def self.id2obj(tree, id) tpath = tree.path TreeNodeID_TBL.mutex.synchronize{ if TreeNodeID_TBL[tpath] if TreeNodeID_TBL[tpath][id] TreeNodeID_TBL[tpath][id] else begin # self.new(tree, nil, 'node'=>Integer(id)) id = Integer(id) if bool(tk_call(@tpath, 'exists', id)) (obj = self.allocate).instance_eval{ @parent = @tree = tree @tpath = tpath @path = @id = id TreeNodeID_TBL[@tpath] = {} unless TreeNodeID_TBL[@tpath] TreeNodeID_TBL[@tpath][@id] = self } obj else id end rescue id end end else id end } end
new(tree, parent, keys={})
Link
# File ext/tk/lib/tkextlib/blt/tree.rb, line 54 def self.new(tree, parent, keys={}) keys = _symbolkey2str(keys) tpath = tree.path TreeNodeID_TBL.mutex.synchronize{ TreeNodeID_TBL[tpath] ||= {} if (id = keys['node']) && (obj = TreeNodeID_TBL[tpath][id]) keys.delete('node') tk_call(tree.path, 'move', id, parent, keys) if parent return obj end (obj = self.allocate).instance_eval{ initialize(tree, parent, keys) TreeNodeID_TBL[tpath][@id] = self } obj } end
new(tree, parent, keys={})
Link
# File ext/tk/lib/tkextlib/blt/tree.rb, line 74 def initialize(tree, parent, keys={}) @parent = @tree = tree @tpath = @parent.path if (id = keys['node']) && bool(tk_call(@tpath, 'exists', id)) @path = @id = id keys.delete('node') tk_call(@tpath, 'move', @id, parent, keys) if parent else parent = tk_call(@tpath, 'root') unless parent @path = @id = tk_call(@tpath, 'insert', parent, keys) end end
Instance Public methods
apply(keys={})
Link
children()
Link
copy(parent, keys={})
Link
copy_to(dest_tree, parent, keys={})
Link
degree()
Link
delete()
Link
depth()
Link
dump()
Link
dump_to_file(file)
Link
exist?(keys={})
Link
find(keys={})
Link
find_child(label)
Link
first_child()
Link
fullpath()
Link
get()
Link
get_value(key, default_val=None)
Link
index()
Link
keys()
Link
label(text = nil)
Link
label=(text)
Link
last_child()
Link
leaf?()
Link
link?()
Link
move(dest, keys={})
Link
next()
Link
next_sibling()
Link
parent()
Link
position()
Link
prev_sibling()
Link
previous()
Link
restore(str, keys={})
Link
restore_from_file(file, keys={})
Link
restore_overwrite(str, keys={})
Link
restore_overwrite_from_file(file, keys={})
Link
root()
Link
root?()
Link
set(data)
Link
size()
Link
sort(keys={})
Link
type(key)
Link
unset(*keys)
Link