summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-10-02 16:20:14 (GMT)
committerBarry Warsaw <barry@python.org>1998-10-02 16:20:14 (GMT)
commit4638c5b7f351da1156a5f365646935510b67d97a (patch)
treed904780878f26471e5e2d7891b362984ce859c4a /Tools
parenteb61fbdba836454f3f720ba19b5ca8c724dab100 (diff)
downloadcpython-4638c5b7f351da1156a5f365646935510b67d97a.zip
cpython-4638c5b7f351da1156a5f365646935510b67d97a.tar.gz
cpython-4638c5b7f351da1156a5f365646935510b67d97a.tar.bz2
Docstring
Diffstat (limited to 'Tools')
-rw-r--r--Tools/pynche/StripViewer.py26
-rw-r--r--Tools/pynche/Switchboard.py14
-rw-r--r--Tools/pynche/TextViewer.py19
3 files changed, 58 insertions, 1 deletions
diff --git a/Tools/pynche/StripViewer.py b/Tools/pynche/StripViewer.py
index db825e3..c6e2fbe 100644
--- a/Tools/pynche/StripViewer.py
+++ b/Tools/pynche/StripViewer.py
@@ -1,3 +1,29 @@
+"""Strip viewer and related widgets.
+
+The classes in this file implement the StripViewer shown in the top two thirds
+of the main Pynche window. It consists of three StripWidgets which display
+the variations in red, green, and blue respectively of the currently selected
+r/g/b color value.
+
+Each StripWidget shows the color variations that are reachable by varying an
+axis of the currently selected color. So for example, if the color is
+
+ (R,G,B)=(127,163,196)
+
+then the Red variations show colors from (0,163,196) to (255,163,196), the
+Green variations show colors from (127,0,196) to (127,255,196), and the Blue
+variations show colors from (127,163,0) to (127,163,255).
+
+The selected color is always visible in all three StripWidgets, and in fact
+each StripWidget highlights the selected color, and has an arrow pointing to
+the selected chip, which includes the value along that particular axis.
+
+Clicking on any chip in any StripWidget selects that color, and updates all
+arrows and other windows. By toggling on Update while dragging, Pynche will
+select the color under the cursor while you drag it, but be forewarned that
+this can be slow.
+"""
+
import string
from Tkinter import *
import ColorDB
diff --git a/Tools/pynche/Switchboard.py b/Tools/pynche/Switchboard.py
index aaf67ab..503752e 100644
--- a/Tools/pynche/Switchboard.py
+++ b/Tools/pynche/Switchboard.py
@@ -1,3 +1,17 @@
+"""Switchboard class.
+
+This class is used to coordinate updates among all Viewers. Every Viewer must
+conform to the following interface:
+
+ - it must include a method called update_yourself() which takes three
+ arguments; the red, green, and blue values of the selected color.
+
+ - When a Viewer selects a color and wishes to update all other Views, it
+ should call update_views() on the Switchboard object. Not that the
+ Viewer typically does *not* update itself before calling update_views(),
+ since this would cause it to get updated twice.
+"""
+
class Switchboard:
def __init__(self, colordb):
self.__views = []
diff --git a/Tools/pynche/TextViewer.py b/Tools/pynche/TextViewer.py
index 9fdab07..9e77a02 100644
--- a/Tools/pynche/TextViewer.py
+++ b/Tools/pynche/TextViewer.py
@@ -1,3 +1,20 @@
+"""TextViewer class.
+
+The TextViewer allows you to see how the selected color would affect various
+characteristics of a Tk text widget. This is an output viewer only.
+
+In the top part of the window is a standard text widget with some sample text
+in it. You are free to edit this text in any way you want (TBD: allow you to
+change font characteristics). If you want changes in other viewers to update
+text characteristics, turn on Track color changes.
+
+To select which characteristic tracks the change, select one of the radio
+buttons in the window below. Text foreground and background affect the text
+in the window above. The Selection is what you see when you click the middle
+button and drag it through some text. The Insertion is the insertion cursor
+in the text window (which only has a background).
+"""
+
import sys
from Tkinter import *
from pynche import __version__
@@ -30,7 +47,7 @@ textual displays.''')
self.__trackp = BooleanVar()
self.__trackp.set(0)
self.__which = IntVar()
- self.__which.set(4)
+ self.__which.set(0)
#
# track toggle
self.__t = Checkbutton(root, text='Track color changes',