summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-10-01 03:08:07 (GMT)
committerBarry Warsaw <barry@python.org>1998-10-01 03:08:07 (GMT)
commitd344165f48aa985d5a65bbc7351599e208bbbfdb (patch)
treef05726507a22e5b7a8000c2fd1bb8779b65d8c57 /Tools
parentaa40b556fd12b358a634389a25dc0bef60744893 (diff)
downloadcpython-d344165f48aa985d5a65bbc7351599e208bbbfdb.zip
cpython-d344165f48aa985d5a65bbc7351599e208bbbfdb.tar.gz
cpython-d344165f48aa985d5a65bbc7351599e208bbbfdb.tar.bz2
Added options to visible window
Diffstat (limited to 'Tools')
-rw-r--r--Tools/pynche/StripViewer.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/Tools/pynche/StripViewer.py b/Tools/pynche/StripViewer.py
index 98074c1..3955544 100644
--- a/Tools/pynche/StripViewer.py
+++ b/Tools/pynche/StripViewer.py
@@ -126,13 +126,14 @@ class StripWidget:
numchips = _NUMCHIPS,
generator = None,
axis = None,
- label = ''):
+ label = '',
+ uwdvar = None):
# instance variables
self.__generator = generator
self.__axis = axis
self.__numchips = numchips
assert self.__axis in (0, 1, 2)
- self.__update_while_dragging = 0
+ self.__uwd = uwdvar
# the last chip selected
self.__lastchip = None
self.__sb = switchboard
@@ -202,7 +203,7 @@ class StripWidget:
color = self.__chips[chip[0]-1]
red, green, blue = ColorDB.rrggbb_to_triplet(color)
etype = int(event.type)
- if (etype == BTNUP or self.__update_while_dragging):
+ if (etype == BTNUP or self.__uwd.get()):
# update everyone
self.__sb.update_views(red, green, blue)
else:
@@ -259,31 +260,35 @@ class StripWidget:
# move the arrows around
self.__trackarrow(chip, (red, green, blue))
- def set_update_while_dragging(self, flag):
- self.__update_while_dragging = flag
-
-
class StripViewer:
def __init__(self, switchboard, parent=None):
self.__sb = switchboard
# create a frame inside the parent
- self.__frame = Frame(parent)
+ self.__frame = Frame(parent, relief=GROOVE, borderwidth=2)
self.__frame.pack()
+ uwd = BooleanVar()
self.__reds = StripWidget(switchboard, self.__frame,
generator=constant_cyan_generator,
axis=0,
- label='Red Variations')
+ label='Red Variations',
+ uwdvar=uwd)
self.__greens = StripWidget(switchboard, self.__frame,
generator=constant_magenta_generator,
axis=1,
- label='Green Variations')
+ label='Green Variations',
+ uwdvar=uwd)
self.__blues = StripWidget(switchboard, self.__frame,
generator=constant_yellow_generator,
axis=2,
- label='Blue Variations')
+ label='Blue Variations',
+ uwdvar=uwd)
+ self.__uwd = Checkbutton(self.__frame,
+ text='Update while dragging',
+ variable=uwd)
+ self.__uwd.pack()
def update_yourself(self, red, green, blue):
self.__reds.update_yourself(red, green, blue)