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
3a476e9b
Commit
3a476e9b
authored
Oct 06, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track color changes: disable buttons and their labels when turned off
parent
332aa4cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
13 deletions
+28
-13
Tools/pynche/TextViewer.py
Tools/pynche/TextViewer.py
+28
-13
No files found.
Tools/pynche/TextViewer.py
View file @
3a476e9b
...
...
@@ -53,7 +53,8 @@ textual displays.''')
# track toggle
self
.
__t
=
Checkbutton
(
root
,
text
=
'Track color changes'
,
variable
=
self
.
__trackp
,
relief
=
GROOVE
)
relief
=
GROOVE
,
command
=
self
.
__toggletrack
)
self
.
__t
.
pack
(
fill
=
X
,
expand
=
YES
)
frame
=
self
.
__frame
=
Frame
(
root
)
frame
.
pack
()
...
...
@@ -85,6 +86,7 @@ textual displays.''')
value
=
(
row
-
2
)
*
2
+
col
-
1
)
r
.
grid
(
row
=
row
,
column
=
col
)
self
.
__radios
.
append
(
r
)
self
.
__toggletrack
()
def
__quit
(
self
,
event
=
None
):
sys
.
exit
(
0
)
...
...
@@ -98,16 +100,29 @@ textual displays.''')
def
__forceupdate
(
self
,
event
=
None
):
self
.
__sb
.
update_views_current
()
def
__toggletrack
(
self
,
event
=
None
):
if
self
.
__trackp
.
get
():
state
=
NORMAL
fg
=
self
.
__radios
[
0
][
'foreground'
]
else
:
state
=
DISABLED
fg
=
self
.
__radios
[
0
][
'disabledforeground'
]
for
r
in
self
.
__radios
:
r
.
configure
(
state
=
state
)
for
l
in
self
.
__labels
:
l
.
configure
(
foreground
=
fg
)
def
update_yourself
(
self
,
red
,
green
,
blue
):
colorname
=
ColorDB
.
triplet_to_rrggbb
((
red
,
green
,
blue
))
which
=
self
.
__which
.
get
()
if
which
==
0
:
self
.
__text
.
configure
(
foreground
=
colorname
)
elif
which
==
1
:
self
.
__text
.
configure
(
background
=
colorname
)
elif
which
==
2
:
self
.
__text
.
configure
(
selectforeground
=
colorname
)
elif
which
==
3
:
self
.
__text
.
configure
(
selectbackground
=
colorname
)
elif
which
==
5
:
self
.
__text
.
configure
(
insertbackground
=
colorname
)
if
self
.
__trackp
.
get
():
colorname
=
ColorDB
.
triplet_to_rrggbb
((
red
,
green
,
blue
))
which
=
self
.
__which
.
get
()
if
which
==
0
:
self
.
__text
.
configure
(
foreground
=
colorname
)
elif
which
==
1
:
self
.
__text
.
configure
(
background
=
colorname
)
elif
which
==
2
:
self
.
__text
.
configure
(
selectforeground
=
colorname
)
elif
which
==
3
:
self
.
__text
.
configure
(
selectbackground
=
colorname
)
elif
which
==
5
:
self
.
__text
.
configure
(
insertbackground
=
colorname
)
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