From: Barry Warsaw Date: Tue, 27 Apr 1999 19:51:55 +0000 (+0000) Subject: Use the much nicer tkFileDialog for loading color name database files X-Git-Tag: v1.6a1~1442 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3369927322ed163a98d955461e60d7e5e7f35f37;p=thirdparty%2FPython%2Fcpython.git Use the much nicer tkFileDialog for loading color name database files (thanks Fred!) --- diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py index c8f14e75559b..d8ff8facdb81 100644 --- a/Tools/pynche/PyncheWidget.py +++ b/Tools/pynche/PyncheWidget.py @@ -9,6 +9,8 @@ import os import string from Tkinter import * import tkMessageBox +import tkFileDialog +import ColorDB # Milliseconds between interrupt checks KEEPALIVE_TIMER = 500 @@ -165,12 +167,15 @@ email: bwarsaw@python.org''' % __version__) self.__helpwin.deiconify() def __load(self, event=None): - import FileDialog - import ColorDB while 1: - d = FileDialog.FileDialog(self.__root) - file = d.go(pattern='*.txt', key=self.__dialogstate) - if file is None: + idir, ifile = os.path.split(self.__sb.colordb().filename()) + file = tkFileDialog.askopenfilename( + filetypes=[('Text files', '*.txt'), + ('All files', '*'), + ], + initialdir=idir, + initialfile=ifile) + if not file: # cancel button return try: