Method: Tk::BLT::Treeview::Tag.id2obj

Defined in:
lib/tkextlib/blt/treeview.rb

.id2obj(tree, name) ⇒ Object



1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
# File 'lib/tkextlib/blt/treeview.rb', line 1179

def self.id2obj(tree, name)
  tpath = tree.path
  TreeTagID_TBL.mutex.synchronize{
    if TreeTagID_TBL[tpath]
      if TreeTagID_TBL[tpath][name]
        TreeTagID_TBL[tpath][name]
      else
        #self.new(tree, name)
        (obj = self.allocate).instance_eval{
          @parent = @tree = tree
          @tpath = @parent.path
          @path = @id = name
          TreeTagID_TBL[@tpath] = {} unless TreeTagID_TBL[@tpath]
          TreeTagID_TBL[@tpath][@id] = self
        }
        obj
      end
    else
      id
    end
  }
end