Tkinter Entry blocked by tkFileDialog

L

Leonhard Vogt

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top