Tkinter Entry blocked by tkFileDialog

Leonhard Vogt leonhard.vogt at gmx.ch
Thu Oct 2 16:09:38 EDT 2008


Hello

I have the following problem in Python 2.5 on Windows XP.
On Ubuntu I do not see the problem.

I have a Tkinter application as in the following example
The entry-widget is somehow blocked (i cannot type characters into it)
when I call askopenfilename before I create the widget.
Calling askopenfile again (by clicking the button) releases the block,
I can type into the entry as expected.

Could someone please try out the example and tell if you observe the 
blocked entry, too?

Do you know a workaround? I want to call askopenfilename before
creating the widgets, since i use it to choose a config file which 
controls the number and type of widgets I create.

Regards
Leonhard


import Tkinter
import tkFileDialog

tk = Tkinter.Tk()

tkFileDialog.askopenfilename()

Tkinter.Entry(tk).grid()
Tkinter.Button(tk, text='ask', command=tkFileDialog.askopenfilename).grid()

tk.mainloop()





More information about the Python-list mailing list