Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more

In Files

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

Class/Module Index [+]

Quicksearch

Tk::Tile::Treeview::Root

Public Class Methods

new(tree, keys = {}) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 900
def self.new(tree, keys = {})
  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]['']
      obj = Tk::Tile::Treeview::Item::ItemID_TBL[tpath]['']
    else
      #super(tree, keys)
      (obj = self.allocate).instance_eval{
        @parent = @t = tree
        @tpath = tree.path
        @path = @id = ''
        Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
        Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
      }
    end
  }
  obj.configure(keys) if keys && ! keys.empty?
  obj
end
            
new(tree, keys = {}) click to toggle source
 
               # File tk/lib/tkextlib/tile/treeview.rb, line 922
def initialize(tree, keys = {})
  # dummy:: not called by 'new' method
  @parent = @t = tree
  @tpath = tree.path
  @path = @id = ''
  Tk::Tile::Treeview::Item::ItemID_TBL.mutex.synchronize{
    Tk::Tile::Treeview::Item::ItemID_TBL[@tpath] ||= {}
    Tk::Tile::Treeview::Item::ItemID_TBL[@tpath][@id] = self
  }
end