Docstring
This commit is contained in:
parent
eb61fbdba8
commit
4638c5b7f3
|
@ -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
|
import string
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import ColorDB
|
import ColorDB
|
||||||
|
|
|
@ -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:
|
class Switchboard:
|
||||||
def __init__(self, colordb):
|
def __init__(self, colordb):
|
||||||
self.__views = []
|
self.__views = []
|
||||||
|
|
|
@ -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
|
import sys
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
from pynche import __version__
|
from pynche import __version__
|
||||||
|
@ -30,7 +47,7 @@ textual displays.''')
|
||||||
self.__trackp = BooleanVar()
|
self.__trackp = BooleanVar()
|
||||||
self.__trackp.set(0)
|
self.__trackp.set(0)
|
||||||
self.__which = IntVar()
|
self.__which = IntVar()
|
||||||
self.__which.set(4)
|
self.__which.set(0)
|
||||||
#
|
#
|
||||||
# track toggle
|
# track toggle
|
||||||
self.__t = Checkbutton(root, text='Track color changes',
|
self.__t = Checkbutton(root, text='Track color changes',
|
||||||
|
|
Loading…
Reference in New Issue