summaryrefslogtreecommitdiffstats
path: root/Tools/pynche/TypeinViewer.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-10-22 03:25:59 (GMT)
committerBarry Warsaw <barry@python.org>1998-10-22 03:25:59 (GMT)
commitca07ba00acdd020e0c179277ed829a8ce1664245 (patch)
tree03ddbed7626ca441d4c90d599b2028773f8e298c /Tools/pynche/TypeinViewer.py
parent04da10c7a2fa0bd060e8052a9fe3d47623324b94 (diff)
downloadcpython-ca07ba00acdd020e0c179277ed829a8ce1664245.zip
cpython-ca07ba00acdd020e0c179277ed829a8ce1664245.tar.gz
cpython-ca07ba00acdd020e0c179277ed829a8ce1664245.tar.bz2
Many changes to support a second mode of operation. Pynche can now be
run either as a standalone application (by running pynche or pynche.pyw), or as a modal dialog inside another application. This can be done by importing pyColorChooser and running askcolor(). The API for this is the same as the tkColorChooser.askcolor() API, namely: When `Okay' is hit, askcolor() returns ((r, g, b), "name"). When `Cancel' is hit, askcolor() returns (None, None). Note the following differences: 1. pyColorChooser.askcolor() takes an optional keyword `master' which if set tells Pynche to run as a modal dialog. `master' is a Tkinter parent window. Without the `master' keyword Pynche runs standalone. 2. in pyColorChooser.askcolor() will return a Tk/X11 color name as "name" if there is an exact match, otherwise it will return a color spec, e.g. "#rrggbb". tkColorChooser can't return a color name. There are also some UI differences when running standalone vs. modal. When modal, there is no "File" menu, but instead there are "Okay" and "Cancel" buttons. The implementation of all this is a bit of a hack, but it seems to work moderately well. I'm not guaranteeing the pyColorChooser.Chooser class has the same semantics as the tkColorChooser.Chooser class.
Diffstat (limited to 'Tools/pynche/TypeinViewer.py')
-rw-r--r--Tools/pynche/TypeinViewer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/pynche/TypeinViewer.py b/Tools/pynche/TypeinViewer.py
index 13cb9c7..d10d2a9 100644
--- a/Tools/pynche/TypeinViewer.py
+++ b/Tools/pynche/TypeinViewer.py
@@ -17,7 +17,7 @@ import string
import re
class TypeinViewer:
- def __init__(self, switchboard, parent=None):
+ def __init__(self, switchboard, master=None):
# non-gui ivars
self.__sb = switchboard
optiondb = switchboard.optiondb()
@@ -26,7 +26,7 @@ class TypeinViewer:
self.__uwtyping = BooleanVar()
self.__uwtyping.set(optiondb.get('UPWHILETYPE', 0))
# create the gui
- self.__frame = Frame(parent) #, relief=GROOVE, borderwidth=2)
+ self.__frame = Frame(master, relief=RAISED, borderwidth=1)
self.__frame.grid(row=3, column=1, sticky='NS')
# Red
self.__xl = Label(self.__frame, text='Red:')