title: Unable to Receive Input from GUI
body: <p>I am basically making a program that calculates the perimeter and area of a certain shape. I am using the tkinter GUI in order to do this.</p>
  <p>Anyways, I decided that I wanted the user to highlight the checkbutton when they are done inputting their numbers so that I know when to collect the data from the entry widget in tkinter, but it seems as though my checkbutton is not working.</p>
  <pre><code>def perTriangle(): #PerTriangle means the perimeter of a triangle. 
      tk.Label(window, text = &quot;Enter in the Numbers: &quot;, background = &quot;white&quot;).place(x = 1115, y = 100)
      tk.Label(window, text = &quot;Side 1: &quot;, background = &quot;white&quot;).place(x = 1115, y = 130)
      entry1 = tk.Entry(window)
      entry1.place(x = 1155, y = 130)
      tk.Label(window, text = &quot;Side 2: &quot;, background = &quot;white&quot;).place(x = 1115, y = 160)
      entry2 = tk.Entry(window)
      entry2.place(x = 1155, y = 160)
      tk.Label(window, text = &quot;Side 3: &quot;, background = &quot;white&quot;).place(x = 1115, y = 190)
      entry3 = tk.Entry(window)
      entry3.place(x = 1155, y = 190)
      check1 = tk.IntVar()
      cButton = tk.Checkbutton(window, text = &quot;Enter: &quot;, variable = check1)
      cButton.place(x = 1115, y = 220)
      if check1.get() == 1:
          num1 = float(entry1.get())
          num2 = float(entry2.get())
          num3 = float(entry3.get())
          ans = num1 + num2 + num3
          tk.messagebox.showinfo(&quot;Your Answer is: &quot;, str(ans))
  </code></pre>
  <p>Nothing runs after the checkbutton is checked off. I don't know what I am doing wrong here, because I think everything checks out, but it still doesn't work. I am not getting any syntax errors with this program.</p>
  <p>I then tried to use multiple functions to see if that would do the trick:</p>
  <pre><code>def perTriangle():
      tk.Label(window, text = &quot;Enter in the Numbers: &quot;, background = &quot;white&quot;).place(x = 1115, y = 100)
      tk.Label(window, text = &quot;Side 1: &quot;, background = &quot;white&quot;).place(x = 1115, y = 130)
      entry1 = tk.Entry(window)
      entry1.place(x = 1155, y = 130)
      tk.Label(window, text = &quot;Side 2: &quot;, background = &quot;white&quot;).place(x = 1115, y = 160)
      entry2 = tk.Entry(window)
      entry2.place(x = 1155, y = 160)
      tk.Label(window, text = &quot;Side 3: &quot;, background = &quot;white&quot;).place(x = 1115, y = 190)
      entry3 = tk.Entry(window)
      entry3.place(x = 1155, y = 190)
      check1 = tk.IntVar()
      cButton = tk.Checkbutton(window, text = &quot;Enter: &quot;, variable = check1)
      cButton.place(x = 1115, y = 220)
      isUserDone(check1)
  
  
  def isUserDone(x):
      if x.get() == 1:
          calculationPTriangle()
  
  
  def calculationPTriangle():
      num1 = float(entry1.get())
      num2 = float(entry2.get())
      num3 = float(entry3.get())
      ans = num1 + num2 + num3
      tk.messagebox.showinfo(&quot;Your Answer is: &quot;, str(ans))
  </code></pre>
  <p>Again, I got the same result. What can I do to fix this problem? I appreciate any and all help! Thanks in advance!</p>
  <p>Updated Code after Initial Edit:</p>
  <pre><code>def perTriangle():
      tk.Label(window, text = &quot;Enter in the Numbers: &quot;, background = &quot;white&quot;).place(x = 1115, y = 100)
      tk.Label(window, text = &quot;Side 1: &quot;, background = &quot;white&quot;).place(x = 1115, y = 130)
      entry1 = tk.Entry(window)
      entry1.place(x = 1155, y = 130)
      tk.Label(window, text = &quot;Side 2: &quot;, background = &quot;white&quot;).place(x = 1115, y = 160)
      entry2 = tk.Entry(window)
      entry2.place(x = 1155, y = 160)
      tk.Label(window, text = &quot;Side 3: &quot;, background = &quot;white&quot;).place(x = 1115, y = 190)
      entry3 = tk.Entry(window)
      entry3.place(x = 1155, y = 190)
      check1 = tk.IntVar()
      cButton = tk.Checkbutton(window, text = &quot;Enter: &quot;, variable = check1, command = calculationPTriangle)
      cButton.place(x = 1115, y = 220)
  
  def calculationPTriangle():
      num1 = float(entry1.get())
      num2 = float(entry2.get())
      num3 = float(entry3.get())
      ans = num1 + num2 + num3
      tk.messagebox.showinfo(&quot;Your Answer is: &quot;, str(ans))
  </code></pre>