s_*******@yahoo.com (Sorin Gherman) wrote in message news:<ac**************************@posting.google. com>...
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?
Ah, the pesky Tk root window. You can minimize it, but I don't think
you can make it disappear completely (without nuking the rest of Tk).
Try this-
import Tkinter, tkFileDialog
tkroot = Tkinter.Tk()
tkroot.iconify()
tkFileDialog.askopenfile()
# If you're not doing anything with Tk besides prompting for the file,
# you'll want to get ride of the root window after askopenfile-
tkroot.destroy()
Alternately, you could just put a pretty picture in the root window
and call it a feature =)