228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
# File 'lib/tkextlib/tktable/tktable.rb', line 228
def self.new(parent, name, keys=nil)
obj = nil
CellTagID_TBL.mutex.synchronize{
if CellTagID_TBL[parent.path] && CellTagID_TBL[parent.path][name]
obj = CellTagID_TBL[parent.path][name]
else
(obj = self.allocate).instance_eval{
@parent = @t = parent
@tpath = parent.path
@path = @id = name
CellTagID_TBL[@tpath] = {} unless CellTagID_TBL[@tpath]
CellTagID_TBL[@tpath][@id] = self
}
end
}
obj.configure(keys) if keys && ! keys.empty?
obj
end
|