title: Ruby TkButton won't run proc
body: <p>I have a ruby program that uses the TK gui package and I am having trouble with TkButton, specifically the command part.  I am trying to run a method that's in the same class when the button is clicked.  My code is below.  I'm very new to Ruby but not programming in general.  When the button is clicked in the gui I get an Application error that says "Error: NameError: unknown option..." where it identifies the method call in the button as the error cause.  Can someone explain what I'm doing wrong? I'm using RubyMine to develop.</p>
  
  <p>Code:</p>
  
  <pre><code>    require 'tk'
      require 'test/unit'
      require_relative 'calc'
      require_relative 'calcTest'
  
      class CalcUIK
  
  
        def test_add
          calc = Calc.new
          expected = Calc.add tk6.get().to_i,tk6.get().to_i
          tk8['textvariable'] = 'Result: ' + expected
        end
  
        hello = TkRoot.new do
          title "Hello World"
          # the min size of window
          minsize(400,400)
        end
        tk1 = TkLabel.new(hello) do
          text 'Super Calculator'
          foreground 'red'
          pack { padx 15; pady 15; side 'left'}
        end
  
        tk5 = TkLabel.new(hello) do
          text 'Enter two numbers to math'
          foreground 'blue'
          pack { padx 15; pady 15; side 'left'}
        end
  
        tk6 = TkEntry.new(hello) do
          foreground 'blue'
          pack { padx 15; pady 15; side 'left'}
        end
  
        tk7 = TkEntry.new(hello) do
          foreground 'blue'
          pack { padx 15; pady 15; side 'left'}
        end
  
        tk8 = TkLabel.new(hello) do
          textvariable
          foreground 'blue'
          pack { padx 15; pady 15; side 'left'}
        end
  
        tk2 = TkButton.new(hello){
          text 'Add'
          command (proc {self.test_add})
          pack('padx'=&gt;'20')
          pack('side'=&gt;'left')
        }
      end
         Tk.mainloop
  </code></pre>
  
  <p>PS I know that this code is kind of dumb but it is just a dummy program to set some more important things up.  The issue I need to resolve is why the button click is not executing the test_add method. Thanks.</p>