I
Irmen de Jong
Hi,
I'm having trouble with the code below.
It's just a regular Tk text widget in which you can type and
select text as expected, however the call to tkFileDialog.askopenfilename()
seems to screw things up. After the file dialog, I can no longer use
the Text widget (typing, selecting, it doesn't work anymore!)
What am I doing wrong?
TIA,
--Irmen de Jong
-----test.py----
import Tkinter, tkFileDialog
window=Tkinter.Tk()
txt=Tkinter.Text(window)
txt.insert(Tkinter.END,"Choose a file, then try to select me")
txt.pack()
name=tkFileDialog.askopenfilename()
txt.insert(Tkinter.END,"\nFile chosen: "+name)
window.mainloop()
I'm having trouble with the code below.
It's just a regular Tk text widget in which you can type and
select text as expected, however the call to tkFileDialog.askopenfilename()
seems to screw things up. After the file dialog, I can no longer use
the Text widget (typing, selecting, it doesn't work anymore!)
What am I doing wrong?
TIA,
--Irmen de Jong
-----test.py----
import Tkinter, tkFileDialog
window=Tkinter.Tk()
txt=Tkinter.Text(window)
txt.insert(Tkinter.END,"Choose a file, then try to select me")
txt.pack()
name=tkFileDialog.askopenfilename()
txt.insert(Tkinter.END,"\nFile chosen: "+name)
window.mainloop()