In Files

  • tk/lib/tkextlib/tcllib/tkpiechart.rb

Class/Module Index [+]

Quicksearch

Tk::Tcllib::Tkpiechart::Slice

Public Class Methods

new(pie, *args) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 170
def initialize(pie, *args)
  unless pie.kind_of?(Pie) && pie != :no_create
    fail ArgumentError, "expects TkPiechart::Pie for 1st argument"
  end

  if pie == :no_create
    @pie, @tag_key = args
  else
    text = args[0] || None
    @pie = pie
    @tag_key = tk_call_without_enc('pie::newSlice', @pie.tag_key, text)
  end
  @parent = @c = @pie.canvas
  @path = @parent.path

  @pie._entry_slice(self)

  @id = "slices(#{@tag_key})"
  @tag = TkcNamedTag.new(@pie.canvas, @id)

  CItemID_TBL.mutex.synchronize{
    CItemID_TBL[@path] = {} unless CItemID_TBL[@path]
    CItemID_TBL[@path][@id] = self
  }
end
            

Public Instance Methods

delete() click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 206
def delete
  tk_call_without_enc('pie::deleteSlice', @pie.tag_key, @tag_key)
  CItemID_TBL.mutex.synchronize{
    CItemID_TBL[@path].delete(@id) if CItemID_TBL[@path]
  }
  @pie._delete_slice(self)
  self
end
            
label(text) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 221
def label(text)
  tk_call_without_enc('pie::labelSlice', @pie.tag_key, @tag_key, text)
  self
end
            
pie() click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 202
def pie
  @pie
end
            
size(share, disp=None) click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 215
def size(share, disp=None)
  tk_call_without_enc('pie::sizeSlice',
                      @pie.tag_key, @tag_key, share, disp)
  self
end
            
tag() click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 199
def tag
  @tag
end
            
tag_key() click to toggle source
 
               # File tk/lib/tkextlib/tcllib/tkpiechart.rb, line 196
def tag_key
  @tag_key
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.