# class Tk::Tcllib::Tkpiechart::Pie

### Public Instance Methods

_delete_slice(slice) click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 123
    def _delete_slice(slice)
      @slice_tbl.delete(slice.to_eval)
    end

_entry_slice(slice) click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 120
    def _entry_slice(slice)
      @slice_tbl[slice.to_eval] = slice
    end

canvas() click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 117
    def canvas
      @c
    end

delete() click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 127
    def delete
      tk_call_without_enc('::stooop::delete', @tag_key)
      CItemID_TBL.mutex.synchronize{
        CItemID_TBL[@path].delete(@id) if CItemID_TBL[@path]
      }
      self
    end

delete_slice(slice) click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 139
    def delete_slice(slice)
      unless slice.kind_of?(Slice)
        unless (slice = @slice_tbl[slice])
          return tk_call_without_enc('pie::deleteSlice', @tag_key, slice)
        end
      end
      unless slice.kind_of?(Slice) && slice.pie == self
        fail ArgumentError, "argument is not a slice of self"
      end
      slice.delete
    end

new_slice(text=None) click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 135
    def new_slice(text=None)
      Slice.new(self, text)
    end

selected_slices() click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 151
    def selected_slices
      tk_split_simplelist(tk_call_without_enc('pie::selectedSlices',
                                              @tag_key)).collect{|slice|
        @slice_tbl[slice] || Slice.new(:no_create, self, slice)
      }
    end

tag() click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 114
    def tag
      @tag
    end

tag_key() click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 111
    def tag_key
      @tag_key
    end

### Private Instance Methods

create_self(x, y, width, height, keys=None) click to toggle source

    # File lib/tkextlib/tcllib/tkpiechart.rb, line 92
    def create_self(x, y, width, height, keys=None)
      if keys and keys != None
        @tag_key = tk_call_without_enc('::stooop::new', 'pie',
                                       @c, x, y, *hash_kv(keys, true))
      else
        @tag_key = tk_call_without_enc('::stooop::new', 'pie', @c, x, y)
      end

      @slice_tbl = {}

      id = "pie(#{@tag_key})"

      @tag = @tag_pie = TkcNamedTag(@c, id)
      @tag_slices = TkcNamedTag(@c, "pieSlices(#{@tag_key})")

      id
    end