empty window when using askopenfile

Fredrik Lundh fredrik at pythonware.com
Fri Apr 16 15:19:00 EDT 2004


Sorin Gherman wrote:

> Is there any way to minimize/hide the annoying default, empty Tk
> window that shows behind the native file opening dialog , when using
> askopenfile, etc, in tkCommonDialog?

explicitly create the root window, and withdraw it from the
screen before you call askopenfile:

    import Tkinter

    root = Tkinter.Tk()
    root.withdraw()

    file = tkFileDialog.askopenfile(...)

</F>

Got Tkinter questions?
http://mail.python.org/mailman/listinfo/tkinter-discuss
has the answers.







More information about the Python-list mailing list