Method: Tk::BLT::PlotComponent::Crosshairs.new

Defined in:
lib/tkextlib/blt/component.rb

.new(chart, keys = {}) ⇒ Object



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/tkextlib/blt/component.rb', line 588

def self.new(chart, keys={})
  obj = nil
  CrosshairsID_TBL.mutex.synchronize{
    unless (obj = CrosshairsID_TBL[chart.path])
      (obj = self.allocate).instance_eval{
        @parent = @chart = chart
        @cpath = @chart.path
        @path = @id = 'crosshairs'
        Crosshairs::CrosshairsID_TBL[@cpath] = self
      }
    end
  }
  chart.crosshair_configure(keys) if obj && ! keys.empty?
  obj
end