I have a simple TKinter GUI that has a text entry box and a button. I want to enter text, click the button, and have my program print the text. The GUI works fine, except when I click on the text entry box and type I don't see the cursor or the text until I resize the window or click the button. When I click the button the text shows up in the entry box and is returned. The GUI is not updating as I enter text. I'm running Python 3.4 on OS X 10.10. Any ideas would be welcome.
Here is the code:
#!/usr/bin/env python
from tkinter import *
def getstring():
filter_string= sfilter.get()
print('User Entered:', filter_string)
root.destroy()
return
root = Tk()
root.geometry('400x400+500+300')
root.title("Extract")
sfilter= StringVar()
label1= Label(root, text= "Design Corner Filter:").grid(row=1, column=1)
dfilter_box= Entry(root, textvariable=sfilter).grid(row=1,column=2)
button1= Button(root, text= 'Plot', command= getstring).grid(row=2, column=2)
root.mainloop()