klappnase at freenet.de
Mon Nov 14 22:10:25 CET 2005
On Mon, 14 Nov 2005 14:42:27 +0100 (MET)
K.Weinert at gmx.net wrote:
> I want to learn Tkinter and try to build a small File search dialog. Tkinter
> is nice, but here is a problem where I am stuck:
> I want to allow the dialog's user to pick a directory. The widget for this
> is tkFileDialog.Directory. But when I start the Directory-Window, it is
> possible move the focus back to my File Search dialog. Thus it is possible
> but not wanted to create several "Pick directory" windows. I tried to make
> the Directory instance modal by calling .grab_set() but this raises an
> attribute error. Here is a minimal example:
I guess the tkFileDialog.Directory class isn't intended to be used directly.
Try tkFileDialog.askdirectory() instead.
If there are problems with the grab state, try passing "parent=self.top" to askdirectory().
I hope this helps
More information about the Tutor