Extended maintenance of Ruby 1.9.3 ended on February 23, 2015. Read more
# File tk/lib/tkextlib/vu/pie.rb, line 236
def self.new(parent, name, *args)
obj = nil
SliceID_TBL.mutex.synchronize{
if SliceID_TBL[parent.path] && SliceID_TBL[parent.path][name]
obj = SliceID_TBL[parent.path][name]
else
#super(parent, name, *args)
unless parent.kind_of?(Tk::Vu::Pie)
fail ArgumentError, "expect a Tk::Vu::Pie instance for 1st argument"
end
obj = self.allocate
obj.instance_eval{
@parent = @pie = parent
@ppath = parent.path
@path = @id = name.to_s
SliceID_TBL[@ppath] = {} unless SliceID_TBL[@ppath]
SliceID_TBL[@ppath][@id] = self
}
end
}
obj.instance_eval{
if args[-1].kind_of?(Hash)
keys = args.unshift
end
@pie.set(@id, *args)
configure(keys)
}
obj
end
# File tk/lib/tkextlib/vu/pie.rb, line 267
def initialize(parent, name, *args)
# dummy:: not called by 'new' method
unless parent.kind_of?(Tk::Vu::Pie)
fail ArgumentError, "expect a Tk::Vu::Pie instance for 1st argument"
end
@parent = @pie = parent
@ppath = parent.path
@path = @id = name.to_s
SliceID_TBL.mutex.synchronize{
SliceID_TBL[@ppath] = {} unless SliceID_TBL[@ppath]
SliceID_TBL[@ppath][@id] = self
}
if args[-1].kind_of?(Hash)
keys = args.unshift
end
@pie.set(@id, *args)
configure(keys)
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.