# File tk/lib/tkextlib/tile/treeview.rb, line 1071 def __destroy_hook__ Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{ Tk::Tile::Treeview::Item::ItemID_TBL.delete(@path) } Tk::Tile::Treeview::Tag::ItemID_TBL.mutex.synchronize{ Tk::Tile::Treeview::Tag::ItemID_TBL.delete(@path) } end
# File tk/lib/tkextlib/tile/treeview.rb, line 1100 def bbox(item, column=None) list(tk_send('item', 'bbox', item, column)) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1104 def children(item) simplelist(tk_send_without_enc('children', item)).collect{|id| Tk::Tile::Treeview::Item.id2obj(self, id) } end
# File tk/lib/tkextlib/tile/treeview.rb, line 1172 def column_identify(x, y) tk_send('identify', 'column', x, y) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1115 def delete(*items) tk_send_without_enc('delete', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1120 def detach(*items) tk_send_without_enc('detach', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1125 def exist?(item) bool(tk_send_without_enc('exists', _get_eval_enc_str(item))) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1129 def focus_item(item = nil) if item tk_send('focus', item) item else id = tk_send('focus') (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id) end end
# File tk/lib/tkextlib/tile/treeview.rb, line 1266 def get(item, col) tk_send('set', item, col) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1253 def get_directory(item) # tile-0.7+ ret = [] lst = simplelist(tk_send('set', item)) until lst.empty? col = lst.shift val = lst.shift ret << [col, val] end ret end
# File tk/lib/tkextlib/tile/treeview.rb, line 1139 def identify(x, y) # tile-0.7.2 or previous ret = simplelist(tk_send('identify', x, y)) case ret[0] when 'heading', 'separator' ret[-1] = num_or_str(ret[-1]) when 'cell' ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1]) ret[-1] = num_or_str(ret[-1]) when 'item', 'row' ret[1] = Tk::Tile::Treeview::Item.id2obj(self, ret[1]) end end
# File tk/lib/tkextlib/tile/treeview.rb, line 1162 def identify_element(x, y) tk_send('identify', 'element', x, y) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1157 def identify_item(x, y) id = tk_send('identify', 'item', x, y) (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1153 def identify_region(x, y) tk_send('identify', 'region', x, y) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1177 def index(item) number(tk_send('index', item)) end
def insert(parent, idx=‘end’, keys={})
keys = _symbolkey2str(keys) id = keys.delete('id') if id num_or_str(tk_send('insert', parent, idx, '-id', id, *hash_kv(keys))) else num_or_str(tk_send('insert', parent, idx, *hash_kv(keys))) end
end
# File tk/lib/tkextlib/tile/treeview.rb, line 1190 def insert(parent, idx='end', keys={}) Tk::Tile::Treeview::Item.new(self, parent, idx, keys) end
def instate(spec, cmd=Proc.new)
tk_send('instate', spec, cmd)
end def state(spec=None)
tk_send('state', spec)
end
# File tk/lib/tkextlib/tile/treeview.rb, line 1201 def move(item, parent, idx) tk_send('move', item, parent, idx) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1206 def next_item(item) id = tk_send('next', item) (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1211 def parent_item(item) if (id = tk_send('parent', item)).empty? Tk::Tile::Treeview::Root.new(self) else Tk::Tile::Treeview::Item.id2obj(self, id) end end
# File tk/lib/tkextlib/tile/treeview.rb, line 1219 def prev_item(item) id = tk_send('prev', item) (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1096 def root Tk::Tile::Treeview::Root.new(self) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1166 def row_identify(x, y) id = tk_send('identify', 'row', x, y) (id.empty?)? nil: Tk::Tile::Treeview::Item.id2obj(self, id) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1224 def see(item) tk_send('see', item) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1229 def selection simplelist(tk_send('selection')).collect{|id| Tk::Tile::Treeview::Item.id2obj(self, id) } end
# File tk/lib/tkextlib/tile/treeview.rb, line 1236 def selection_add(*items) tk_send('selection', 'add', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1240 def selection_remove(*items) tk_send('selection', 'remove', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1244 def selection_set(*items) tk_send('selection', 'set', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1248 def selection_toggle(*items) tk_send('selection', 'toggle', array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1269 def set(item, col, value) tk_send('set', item, col, value) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1109 def set_children(item, *items) tk_send_without_enc('children', item, array2tk_list(items.flatten, true)) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1322 def tag_add(tag, *items) fail ArgumentError, "no target items" if items.empty? tk_send('tag', 'add', tagid(tag), *(items.collect{|item| tagid(item)})) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1283 def tag_bind(tag, seq, *args) if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new end _bind([@path, 'tag', 'bind', tag], seq, cmd, *args) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1294 def tag_bind_append(tag, seq, *args) if TkComm._callback_entry?(args[0]) || !block_given? cmd = args.shift else cmd = Proc.new end _bind_append([@path, 'tag', 'bind', tag], seq, cmd, *args) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1305 def tag_bind_remove(tag, seq) _bind_remove([@path, 'tag', 'bind', tag], seq) self end
# File tk/lib/tkextlib/tile/treeview.rb, line 1311 def tag_bindinfo(tag, context=nil) _bindinfo([@path, 'tag', 'bind', tag], context) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1277 def tag_has(tag) tk_split_simplelist(tk_send('tag', 'has', tagid(tag))).collect{|id| Tk::Tile::Treeview::Item.id2obj(self, id) } end
# File tk/lib/tkextlib/tile/treeview.rb, line 1274 def tag_has?(tag, item) bool(tk_send('tag', 'has', tagid(tag), tagid(item))) end
# File tk/lib/tkextlib/tile/treeview.rb, line 1316 def tag_names tk_split_simplelist(tk_send('tag', 'names')).collect{|id| Tk::Tile::Treeview::Tag.id2obj(self, id) } end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.