title: Tkinter changing entry state based on radiobutton
body: <p>I have four radio buttons. Underneath these four button is an <code>Entry</code> widget. I am trying to make this <code>Entry</code> widget only become available to type into when the last radio button is selected. The <code>gui</code> is in a class, as you can see in the code below:</p>
  <pre><code>class Gui:
      def __init__(self):
          pass
  
      def draw(self):
          global root
  
          if not root:
              root  = tk.Tk()
              root.geometry('280x350')
  
              self.type = tk.StringVar()
              self.type_label = tk.Label(text=&quot;Game Mode&quot;)
              self.name_entry = tk.Entry()
              self.name_entry.configure(state=&quot;disabled&quot;)
              self.name_entry.update()
              self.type_entry_one = tk.Radiobutton(text=&quot;Garage&quot;, value=&quot;garage&quot;, variable=self.type, command=self.disable_entry(self.name_entry))
              self.type_entry_two = tk.Radiobutton(text=&quot;Festival&quot;, value=&quot;festival&quot;, variable=self.type, command=self.disable_entry(self.name_entry))
              self.type_entry_three = tk.Radiobutton(text=&quot;Studio&quot;, value=&quot;studio&quot;, variable=self.type, command=self.disable_entry(self.name_entry))
              self.type_entry_four = tk.Radiobutton(text=&quot;Rockslam&quot;, value=&quot;rockslam&quot;, variable=self.type, command=self.enable_entry(self.name_entry))
              
           
              self.type_label.pack()
              self.type_entry_one.pack()
              self.type_entry_two.pack()
              self.type_entry_three.pack()
              self.type_entry_four.pack()
              self.name_entry.pack()
  
              root.mainloop()
  
      def enable_entry(self, entry):
          entry.configure(state=&quot;normal&quot;)
          entry.update()
  
      def disable_entry(self, entry):
          entry.configure(state=&quot;disabled&quot;)
          entry.update()
  
  
  
  
  
  if __name__ == '__main__':
      root = None
      gui = Gui()
      gui.draw()
  </code></pre>
  <p>However, the the self.name_entry is always available to type into. What am I doing wrong. If you still don't understand what is happening then please run this code yourself and you will see.</p>
  <p>Thank you very much for your time and I look forward to responses.</p>