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
5bfac8d7
Commit
5bfac8d7
authored
Mar 10, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate with OptionsWindow... need to hook into Tab key
parent
f67575d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
Tools/pynche/TypeinViewer.py
Tools/pynche/TypeinViewer.py
+19
-5
No files found.
Tools/pynche/TypeinViewer.py
View file @
5bfac8d7
...
...
@@ -7,6 +7,7 @@ class TypeinWidget(Pmw.MegaWidget):
options
=
((
'color'
,
(
128
,
128
,
128
),
self
.
__set_color
),
(
'delegate'
,
None
,
None
),
)
self
.
__update
=
1
self
.
defineoptions
(
kw
,
options
)
Pmw
.
MegaWidget
.
__init__
(
self
,
parent
)
...
...
@@ -23,7 +24,8 @@ class TypeinWidget(Pmw.MegaWidget):
maxwidth
=
4
,
entry_width
=
4
,
validate
=
self
.
__validate
,
modifiedcommand
=
self
.
__modified
)
modifiedcommand
=
self
.
__modified
,
command
=
self
.
__force_modify
)
self
.
__x
.
grid
(
row
=
0
,
column
=
0
)
self
.
__y
=
self
.
createcomponent
(
...
...
@@ -36,7 +38,8 @@ class TypeinWidget(Pmw.MegaWidget):
maxwidth
=
4
,
entry_width
=
4
,
validate
=
self
.
__validate
,
modifiedcommand
=
self
.
__modified
)
modifiedcommand
=
self
.
__modified
,
command
=
self
.
__force_modify
)
self
.
__y
.
grid
(
row
=
1
,
column
=
0
)
self
.
__z
=
self
.
createcomponent
(
...
...
@@ -49,7 +52,8 @@ class TypeinWidget(Pmw.MegaWidget):
maxwidth
=
4
,
entry_width
=
4
,
validate
=
self
.
__validate
,
modifiedcommand
=
self
.
__modified
)
modifiedcommand
=
self
.
__modified
,
command
=
self
.
__force_modify
)
self
.
__z
.
grid
(
row
=
2
,
column
=
0
)
# Check keywords and initialize options
...
...
@@ -68,6 +72,9 @@ class TypeinWidget(Pmw.MegaWidget):
if
obj
==
self
:
return
def
set_update_on_typing
(
self
,
flag
):
self
.
__update
=
flag
#
# PRIVATE INTERFACE
#
...
...
@@ -90,15 +97,22 @@ class TypeinWidget(Pmw.MegaWidget):
return
-
1
# called whenever a text entry is modified
def
__modified
(
self
):
def
__modified
(
self
,
force
=
None
):
# these are guaranteed to be valid, right?
vals
=
map
(
lambda
x
:
x
.
get
(),
(
self
.
__x
,
self
.
__y
,
self
.
__z
))
rgbs
=
tuple
(
map
(
self
.
__str_to_int
,
vals
))
valids
=
map
(
self
.
__validate
,
vals
)
delegate
=
self
[
'delegate'
]
if
(
None
not
in
rgbs
)
and
(
-
1
not
in
valids
)
and
delegate
:
if
((
force
or
self
.
__update
)
and
(
None
not
in
rgbs
)
and
(
-
1
not
in
valids
)
and
delegate
):
#
delegate
.
set_color
(
self
,
rgbs
)
def
__force_modify
(
self
):
self
.
__modified
(
force
=
1
)
# called whenever the color option is changed
def
__set_color
(
self
):
rgbtuple
=
self
[
'color'
]
...
...
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