dummy tk windows

Paul Miller pwmiller1 at adelphia.net
Fri Sep 17 06:39:09 CEST 2004


On Thu, 16 Sep 2004 18:08:12 +0000, Elaine Jackson wrote:

> When I use a function from tkFileDialog outside of a tk GUI context, it
> creates a "dummy" tk window. It would be nice to know how to close these
> windows programmatically. TIA
> 

IIRC, you can't close them without terminating the tcl interpreter (doing
so destructs the implicitly created Tk object you instantiated when you
used the tkFileDialog function).  However, you can hide it with:

import Tkinter
import tkFileDialog

root = Tkinter.Tk()
root.withdraw()
fileOpen = tkFileDialog.Open()
fileOpen.show()

HTH




More information about the Python-list mailing list