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
e7a3131d
Commit
e7a3131d
authored
Sep 29, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got updating with Return/Tab working
parent
462ef196
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
Tools/pynche/TypeinViewer.py
Tools/pynche/TypeinViewer.py
+7
-9
No files found.
Tools/pynche/TypeinViewer.py
View file @
e7a3131d
...
...
@@ -2,12 +2,12 @@ from Tkinter import *
import
string
import
re
class
TypeinViewer
class
TypeinViewer
:
def
__init__
(
self
,
switchboard
,
parent
=
None
):
# non-gui ivars
self
.
__sb
=
switchboard
self
.
__hexp
=
0
self
.
__update_whi
t
e_typing
=
0
self
.
__update_whi
l
e_typing
=
0
# create the gui
self
.
__frame
=
Frame
(
parent
)
self
.
__frame
.
pack
()
...
...
@@ -18,25 +18,19 @@ class TypeinViewer
self
.
__x
.
grid
(
row
=
0
,
column
=
1
)
self
.
__x
.
bindtags
(
self
.
__x
.
bindtags
()
+
(
'Normalize'
,
'Update'
))
self
.
__x
.
bind_class
(
'Normalize'
,
'<Key>'
,
self
.
__normalize
)
self
.
__x
.
bind_class
(
'Update'
,
'<Key>'
,
self
.
__update
)
self
.
__x
.
bind
(
'Return'
,
self
.
__update
)
self
.
__x
.
bind
(
'Tab'
,
self
.
__update
)
self
.
__x
.
bind_class
(
'Update'
,
'<Key>'
,
self
.
__maybeupdate
)
# Green
self
.
__yl
=
Label
(
self
.
__frame
,
text
=
'Green:'
)
self
.
__yl
.
grid
(
row
=
1
,
column
=
0
,
sticky
=
E
)
self
.
__y
=
Entry
(
self
.
__frame
,
width
=
4
)
self
.
__y
.
grid
(
row
=
1
,
column
=
1
)
self
.
__y
.
bindtags
(
self
.
__y
.
bindtags
()
+
(
'Normalize'
,
'Update'
))
self
.
__y
.
bind
(
'Return'
,
self
.
__update
)
self
.
__y
.
bind
(
'Tab'
,
self
.
__update
)
# Blue
self
.
__zl
=
Label
(
self
.
__frame
,
text
=
'Blue:'
)
self
.
__zl
.
grid
(
row
=
2
,
column
=
0
,
sticky
=
E
)
self
.
__z
=
Entry
(
self
.
__frame
,
width
=
4
)
self
.
__z
.
grid
(
row
=
2
,
column
=
1
)
self
.
__z
.
bindtags
(
self
.
__z
.
bindtags
()
+
(
'Normalize'
,
'Update'
))
self
.
__z
.
bind
(
'Return'
,
self
.
__update
)
self
.
__z
.
bind
(
'Tab'
,
self
.
__update
)
def
__normalize
(
self
,
event
=
None
):
ew
=
event
.
widget
...
...
@@ -62,6 +56,10 @@ class TypeinViewer
ew
.
delete
(
0
,
END
)
ew
.
insert
(
0
,
contents
)
def
__maybeupdate
(
self
,
event
=
None
):
if
self
.
__update_while_typing
or
event
.
keysym
in
(
'Return'
,
'Tab'
):
self
.
__update
(
event
)
def
__update
(
self
,
event
=
None
):
redstr
=
self
.
__x
.
get
()
greenstr
=
self
.
__y
.
get
()
...
...
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