summaryrefslogtreecommitdiffstats
path: root/Tools/pynche
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-04-27 19:51:55 (GMT)
committerBarry Warsaw <barry@python.org>1999-04-27 19:51:55 (GMT)
commit3369927322ed163a98d955461e60d7e5e7f35f37 (patch)
tree04522c3757bd6cef722106670b58fc5c2aab3396 /Tools/pynche
parenta853adc11018998f2628d91f9eefb7d02c521674 (diff)
downloadcpython-3369927322ed163a98d955461e60d7e5e7f35f37.zip
cpython-3369927322ed163a98d955461e60d7e5e7f35f37.tar.gz
cpython-3369927322ed163a98d955461e60d7e5e7f35f37.tar.bz2
Use the much nicer tkFileDialog for loading color name database files
(thanks Fred!)
Diffstat (limited to 'Tools/pynche')
-rw-r--r--Tools/pynche/PyncheWidget.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index c8f14e7..d8ff8fa 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: