In Files

  • tk/lib/tkextlib/vu/pie.rb

Methods

Class/Module Index [+]

Quicksearch

Tk::Vu::NamedPieSlice

Public Class Methods

new(parent, name, *args) click to toggle source
 
               # File tk/lib/tkextlib/vu/pie.rb, line 211
def self.new(parent, name, *args)
  if SliceID_TBL[parent.path] && SliceID_TBL[parent.path][name]
    return SliceID_TBL[parent.path][name]
  else
    super(parent, name, *args)
  end
end
            
new(parent, name, *args) click to toggle source
 
               # File tk/lib/tkextlib/vu/pie.rb, line 219
def initialize(parent, name, *args)
  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[@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