Tkinter: focus/text selection problem with tkFileDialog
From: Irmen de Jong (irmen_at_-nospam-remove-this-xs4all.nl)
Date: 04/30/04
- Next message: A. Lloyd Flanagan: "Re: Why we will use obj$func() often"
- Previous message: A. Lloyd Flanagan: "Re: String formatting (%)"
- Next in thread: Peter Otten: "Re: Tkinter: focus/text selection problem with tkFileDialog"
- Reply: Peter Otten: "Re: Tkinter: focus/text selection problem with tkFileDialog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 15:51:40 +0200
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()
- Next message: A. Lloyd Flanagan: "Re: Why we will use obj$func() often"
- Previous message: A. Lloyd Flanagan: "Re: String formatting (%)"
- Next in thread: Peter Otten: "Re: Tkinter: focus/text selection problem with tkFileDialog"
- Reply: Peter Otten: "Re: Tkinter: focus/text selection problem with tkFileDialog"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|