Methods
N
Class Public methods
new()
# File ext/tk/sample/tkextlib/blt/graph6.rb, line 63
  def initialize
    @graph = Tk::BLT::Graph.new(:widgetname=>'graph')

    @root = Tk.root
    @root.minsize(0, 0)

    _set_vectors()
    (1..39).each{|i| @graph.element_create("V#{i}", :x=>@x, :y=>@v[i])}

    @top = Tk::BLT::Tile::Toplevel.new
    legend = Tk::BLT::Graph.new(@top, :widgetname=>'legend',
                                :without_creating=>true)
    @graph.legend_configure(:position=>legend)
    # legend = @graph.legend_window_create(@top, :widgetname=>'legend')
    legend = @graph.legend_window_create(@top)
    legend.pack(:fill=>:both, :expand=>true)

    Tk::BLT::Table.add(@root, @graph, [0,0], :fill=>:both)

    @quit_btn = Tk::BLT::Tile::Button.new(:text=>' quit ', :background=>'red',
                                          :command=>proc{exit})
    Tk::BLT::Table.add(@root, @quit_btn, [1,0], :anchor=>:e, :padx=>10)

    @graph.zoom_stack
    @graph.crosshairs
    @graph.closest_point
    @graph.print_key

    @graph.legend_bind(:all, 'ButtonRelease-1',
                       proc{|w| highlightTrace(w)}, '%W')
    @graph.legend_bind(:all, 'ButtonRelease-3',
                       proc{|w|
                         w.legend_deactivate('*')
                         active = w.element_activate
                         w.element_deactivate(*active)
                       }, '%W')
  end