assign(tree, id)
click to toggle source
def self.assign(tree, id)
tpath = tree.path
obj = nil
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
if Tk::Tile::Treeview::Item::ItemID_TBL[tpath] &&
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
return Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]
end
obj = self.allocate
obj.instance_eval{
@parent = @t = tree
@tpath = tpath
@path = @id = id
}
Tk::Tile::Treeview::Item::ItemID_TBL[tpath] ||= {}
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id] = obj
}
obj
end
id2obj(tree, id)
click to toggle source
def self.id2obj(tree, id)
tpath = tree.path
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
if Tk::Tile::Treeview::Item::ItemID_TBL[tpath]
(Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id])? \
Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]: id
else
id
end
}
end
new(tree, parent_item = '', idx = 'end', keys = {})
click to toggle source
def initialize(tree, parent_item = '', idx = 'end', keys = {})
if parent_item.kind_of?(Hash)
keys = parent_item
idx = 'end'
parent_item = ''
elsif idx.kind_of?(Hash)
keys = idx
idx = 'end'
end
@parent = @t = tree
@tpath = tree.path
@path = @id = _insert_item(@t, parent_item, idx, keys)
Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
ItemID_TBL[@tpath] = {} unless ItemID_TBL[@tpath]
ItemID_TBL[@tpath][@id] = self
}
end
bbox(column=None)
click to toggle source
def bbox(column=None)
@t.bbox(@id, column)
end
cget(option)
click to toggle source
def cget(option)
@t.itemcget(@id, option)
end
cget_strict(option)
click to toggle source
def cget_strict(option)
@t.itemcget_strict(@id, option)
end
cget_tkstring(option)
click to toggle source
def cget_tkstring(option)
@t.itemcget_tkstring(@id, option)
end
children()
click to toggle source
def children
@t.children(@id)
end
close()
click to toggle source
def close
configure('open', false)
self
end
configinfo(key=nil)
click to toggle source
def configinfo(key=nil)
@t.itemconfiginfo(@id, key)
end
current_configinfo(key=nil)
click to toggle source
def current_configinfo(key=nil)
@t.current_itemconfiginfo(@id, key)
end
delete()
click to toggle source
def delete
@t.delete(@id)
self
end
detach()
click to toggle source
def detach
@t.detach(@id)
self
end
exist?()
click to toggle source
def exist?
@t.exist?(@id)
end
focus()
click to toggle source
def focus
@t.focus_item(@id)
end
get(col)
click to toggle source
def get(col)
@t.get(@id, col)
end
get_dictionary()
click to toggle source
get_directory()
click to toggle source
def get_directory
@t.get_directory(@id)
end
has_tag?(tag)
click to toggle source
id()
click to toggle source
index()
click to toggle source
def index
@t.index(@id)
end
insert(idx='end', keys={})
click to toggle source
def insert(idx='end', keys={})
@t.insert(@id, idx, keys)
end
move(parent, idx)
click to toggle source
def move(parent, idx)
@t.move(@id, parent, idx)
self
end
next_item()
click to toggle source
def next_item
@t.next_item(@id)
end
open()
click to toggle source
def open
configure('open', true)
self
end
open?()
click to toggle source
def open?
cget('open')
end
parent_item()
click to toggle source
def parent_item
@t.parent_item(@id)
end
prev_item()
click to toggle source
def prev_item
@t.prev_item(@id)
end
see()
click to toggle source
def see
@t.see(@id)
self
end
selection_add()
click to toggle source
def selection_add
@t.selection_add(@id)
self
end
selection_remove()
click to toggle source
def selection_remove
@t.selection_remove(@id)
self
end
selection_set()
click to toggle source
def selection_set
@t.selection_set(@id)
self
end
selection_toggle()
click to toggle source
def selection_toggle
@t.selection_toggle(@id)
self
end
set(col, value)
click to toggle source
def set(col, value)
@t.set(@id, col, value)
end
set_children(*items)
click to toggle source
def set_children(*items)
@t.set_children(@id, *items)
self
end
tag_has?(tag)
click to toggle source
def tag_has?(tag)
@t.tag_has?(tag, @id)
end