class Tk::Tile::Treeview::Root - tk-0.2.0 Documentation

# class Tk::Tile::Treeview::Root

### Public Class Methods

new(tree, keys = {}) click to toggle source

    # File 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 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