Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4638c5b7
Commit
4638c5b7
authored
Oct 02, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docstring
parent
eb61fbdb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
1 deletion
+58
-1
Tools/pynche/StripViewer.py
Tools/pynche/StripViewer.py
+26
-0
Tools/pynche/Switchboard.py
Tools/pynche/Switchboard.py
+14
-0
Tools/pynche/TextViewer.py
Tools/pynche/TextViewer.py
+18
-1
No files found.
Tools/pynche/StripViewer.py
View file @
4638c5b7
"""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
...
...
Tools/pynche/Switchboard.py
View file @
4638c5b7
"""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
=
[]
...
...
Tools/pynche/TextViewer.py
View file @
4638c5b7
"""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'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment