In Files

  • tk/lib/tkextlib/blt/component.rb

Class/Module Index [+]

Quicksearch

Tk::BLT::PlotComponent::Pen

Constants

OBJ_ID
OBJ_TBL

Public Class Methods

id2obj(chart, id) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 735
def self.id2obj(chart, id)
  cpath = chart.path
  return id unless OBJ_TBL[cpath]
  OBJ_TBL[cpath][id]? OBJ_TBL[cpath][id]: id
end
            
new(chart, pen=nil, keys={}) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 741
def self.new(chart, pen=nil, keys={})
  if pen.kind_of?(Hash)
    keys = pen
    pen = nil
  end
  OBJ_TBL[chart.path] = {} unless OBJ_TBL[chart.path]
  return OBJ_TBL[chart.path][pen] if pen && OBJ_TBL[chart.path][pen]
  super(chart, pen, keys)
end
            
new(chart, pen=nil, keys={}) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 751
def initialize(chart, pen=nil, keys={})
  if pen.kind_of?(Hash)
    keys = pen
    pen = nil
  end
  if pen
    @pen = @id = pen.to_s
  else
    @pen = @id = OBJ_ID.join(TkCore::INTERP._ip_id_).freeze
    OBJ_ID[1].succ!
  end
  @path = @id
  @parent = @chart = chart
  @cpath = @chart.path
  Pen::OBJ_TBL[@cpath][@pen] = self
  keys = _symbolkey2str(keys)
  unless keys.delete('without_creating')
    # @chart.pen_create(@pen, keys)
    tk_call(@chart, 'pen', 'create', @pen, keys)
  end
end
            

Public Instance Methods

cget(option) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 781
def cget(option)
  @chart.pen_cget(@id, option)
end
            
configinfo(key=nil) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 788
def configinfo(key=nil)
  @chart.pen_configinfo(@id, key)
end
            
configure(key, value=None) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 784
def configure(key, value=None)
  @chart.pen_configure(@id, key, value)
  self
end
            
current_configinfo(key=nil) click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 791
def current_configinfo(key=nil)
  @chart.current_pen_configinfo(@id, key)
end
            
delete() click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 795
def delete
  @chart.pen_delete(@id)
  self
end
            
id() click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 773
def id
  @id
end
            
name() click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 800
def name
  @pen
end
            
to_eval() click to toggle source
 
               # File tk/lib/tkextlib/blt/component.rb, line 777
def to_eval
  @id
end