title: Obtaining the state of a tkinter entry widget
body: <p>Is there a way to obtain the state current state of an entry widget? I thought I could with a .winfo method, but that doesn't seem to be the case? Trying to create a function/button that acts differently based on the state of an entry widget... So far, no luck... any ideas?</p>
  
  <p>The Entry and Button widgets:</p>
  
  <pre><code>    self.contact_phone = tk.Entry(contact_frame, font='arial 10 bold', relief='flat', bg='grey60', textvariable=self.var3, state='readonly', readonlybackground='grey60')
      self.contact_phone.place(anchor='nw', y=50)
  
      self.change_phone = tk.Button(contact_frame, text='Change', font='arial 10 bold', bd=2, bg='grey80', command=self.changephone)
      self.change_phone.place(anchor='nw', y=48, x=180)
  </code></pre>
  
  <p>the proposed function(left out the open/write to file stuff for brevity):</p>
  
  <pre><code>def changephone(self):
      if #the state of the widget is readonly:
          '''config the widget to allow entry'''
          self.contact_phone.config(state='normal', relief='sunken', bg='white', bd=2)
          '''change the text on the button to reflect the other functionality'''
          self.change_phone.config(text='Apply')
      elif #the state of the widget is normal:
          '''get the new contents and write it to a file'''
          newnumber = self.contact_phone.get()
          #open a file and write the new number to it...
          '''return the widget and button to their previous states'''
          self.contact_phone.config(state='readonly', relief='sunken', readonlybackground='grey60')
          self.change_phone.config(text='Change')
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Mike</p>