In Files

  • tk/lib/tkextlib/tile/treeview.rb

Class/Module Index [+]

Quicksearch

Tk::Tile::Treeview::Item

Constants

ItemID_TBL

Public Class Methods

assign(tree, id) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 626
def self.assign(tree, id)
  tpath = tree.path
  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
  }
  ItemID_TBL[tpath] = {} unless ItemID_TBL[tpath]
  Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id] = obj
  obj
end
            
id2obj(tree, id) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 619
def self.id2obj(tree, id)
  tpath = tree.path
  return id unless Tk::Tile::Treeview::Item::ItemID_TBL[tpath]
  (Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id])? \
        Tk::Tile::Treeview::Item::ItemID_TBL[tpath][id]: id
end
            
new(tree, parent_item = '', idx = 'end', keys = {}) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 656
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)
  ItemID_TBL[@tpath] = {} unless ItemID_TBL[@tpath]
  ItemID_TBL[@tpath][@id] = self
end
            

Public Instance Methods

bbox(column=None) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 705
def bbox(column=None)
  @t.bbox(@id, column)
end
            
cget(option) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 676
def cget(option)
  @t.itemcget(@id, option)
end
            
children() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 709
def children
  @t.children(@id)
end
            
close() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 700
def close
  configure('open', false)
  self
end
            
configinfo(key=nil) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 685
def configinfo(key=nil)
  @t.itemconfiginfo(@id, key)
end
            
configure(key, value=None) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 680
def configure(key, value=None)
  @t.itemconfigure(@id, key, value)
  self
end
            
current_configinfo(key=nil) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 689
def current_configinfo(key=nil)
  @t.current_itemconfiginfo(@id, key)
end
            
delete() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 717
def delete
  @t.delete(@id)
  self
end
            
detach() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 722
def detach
  @t.detach(@id)
  self
end
            
exist?() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 727
def exist?
  @t.exist?(@id)
end
            
focus() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 731
def focus
  @t.focus_item(@id)
end
            
get(col) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 790
def get(col)
  @t.get(@id, col)
end
            
get_dictionary() click to toggle source
Alias for: get_directory
get_directory() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 785
def get_directory
  @t.get_directory(@id)
end
            
Also aliased as: get_dictionary
id() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 672
def id
  @id
end
            
index() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 735
def index
  @t.index(@id)
end
            
insert(idx='end', keys={}) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 739
def insert(idx='end', keys={})
  @t.insert(@id, idx, keys)
end
            
move(parent, idx) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 743
def move(parent, idx)
  @t.move(@id, parent, idx)
  self
end
            
next_item() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 748
def next_item
  @t.next_item(@id)
end
            
open() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 696
def open
  configure('open', true)
  self
end
            
open?() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 693
def open?
  cget('open')
end
            
parent_item() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 752
def parent_item
  @t.parent_item(@id)
end
            
prev_item() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 756
def prev_item
  @t.prev_item(@id)
end
            
see() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 760
def see
  @t.see(@id)
  self
end
            
selection_add() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 765
def selection_add
  @t.selection_add(@id)
  self
end
            
selection_remove() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 770
def selection_remove
  @t.selection_remove(@id)
  self
end
            
selection_set() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 775
def selection_set
  @t.selection_set(@id)
  self
end
            
selection_toggle() click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 780
def selection_toggle
  @t.selection_toggle(@id)
  self
end
            
set(col, value) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 794
def set(col, value)
  @t.set(@id, col, value)
end
            
set_children(*items) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 712
def set_children(*items)
  @t.set_children(@id, *items)
  self
end