diff options
author | Barry Warsaw <barry@python.org> | 1999-04-27 19:51:55 +0000 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 1999-04-27 19:51:55 +0000 |
commit | cd3679b505b1af07d67e5b56f590dbc1cc0a9258 (patch) | |
tree | 1a32548af7f8b2fdffe13b56e6afda5082bc735f /Tools/pynche | |
parent | ba2692eadd710feff68079eee26b1668564a17fe (diff) | |
download | cpython-cd3679b505b1af07d67e5b56f590dbc1cc0a9258.tar.gz |
Use the much nicer tkFileDialog for loading color name database files
(thanks Fred!)
Diffstat (limited to 'Tools/pynche')
-rw-r--r-- | Tools/pynche/PyncheWidget.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py index c8f14e7555..d8ff8facdb 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: |