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
d352d689
Commit
d352d689
authored
Jun 23, 2017
by
csabella
Committed by
terryjreedy
Jun 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-24813: IDLE: Add icon to help_about (#2335)
Patch by Cheryl Sabella
parent
f87b85f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
Lib/idlelib/help_about.py
Lib/idlelib/help_about.py
+12
-4
Lib/idlelib/idle_test/test_help_about.py
Lib/idlelib/idle_test/test_help_about.py
+7
-0
No files found.
Lib/idlelib/help_about.py
View file @
d352d689
...
...
@@ -4,8 +4,8 @@
import
os
from
sys
import
version
from
tkinter
import
Toplevel
,
Frame
,
Label
,
Button
from
tkinter
import
SUNKEN
,
TOP
,
BOTTOM
,
LEFT
,
X
,
BOTH
,
W
,
EW
,
NSEW
from
tkinter
import
Toplevel
,
Frame
,
Label
,
Button
,
PhotoImage
from
tkinter
import
SUNKEN
,
TOP
,
BOTTOM
,
LEFT
,
X
,
BOTH
,
W
,
EW
,
NSEW
,
E
from
idlelib
import
textview
...
...
@@ -62,7 +62,16 @@ class AboutDialog(Toplevel):
header
=
Label
(
frame_background
,
text
=
'IDLE'
,
fg
=
self
.
fg
,
bg
=
self
.
bg
,
font
=
(
'courier'
,
24
,
'bold'
))
header
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
W
,
padx
=
10
,
pady
=
10
)
header
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
E
,
padx
=
10
,
pady
=
10
)
tk_patchlevel
=
self
.
tk
.
call
(
'info'
,
'patchlevel'
)
ext
=
'.png'
if
tk_patchlevel
>=
'8.6'
else
'.gif'
icon
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
'Icons'
,
f'idle_48
{
ext
}
'
)
self
.
icon_image
=
PhotoImage
(
master
=
self
.
_root
(),
file
=
icon
)
logo
=
Label
(
frame_background
,
image
=
self
.
icon_image
,
bg
=
self
.
bg
)
logo
.
grid
(
row
=
0
,
column
=
0
,
sticky
=
W
,
rowspan
=
2
,
padx
=
10
,
pady
=
10
)
byline_text
=
"Python's Integrated DeveLopment Environment"
+
5
*
'
\
n
'
byline
=
Label
(
frame_background
,
text
=
byline_text
,
justify
=
LEFT
,
fg
=
self
.
fg
,
bg
=
self
.
bg
)
...
...
@@ -82,7 +91,6 @@ class AboutDialog(Toplevel):
pyver
=
Label
(
frame_background
,
text
=
'Python version: '
+
release
,
fg
=
self
.
fg
,
bg
=
self
.
bg
)
pyver
.
grid
(
row
=
9
,
column
=
0
,
sticky
=
W
,
padx
=
10
,
pady
=
0
)
tk_patchlevel
=
self
.
tk
.
call
(
'info'
,
'patchlevel'
)
tkver
=
Label
(
frame_background
,
text
=
'Tk version: '
+
tk_patchlevel
,
fg
=
self
.
fg
,
bg
=
self
.
bg
)
tkver
.
grid
(
row
=
9
,
column
=
1
,
sticky
=
W
,
padx
=
2
,
pady
=
0
)
...
...
Lib/idlelib/idle_test/test_help_about.py
View file @
d352d689
...
...
@@ -9,6 +9,7 @@ from idlelib.idle_test.mock_idle import Func
from
idlelib.idle_test.mock_tk
import
Mbox_func
from
idlelib.help_about
import
AboutDialog
as
About
from
idlelib
import
textview
import
os.path
class
LiveDialogTest
(
unittest
.
TestCase
):
"""Simulate user clicking buttons other than [Close].
...
...
@@ -33,6 +34,12 @@ class LiveDialogTest(unittest.TestCase):
"""Test about dialog title"""
self
.
assertEqual
(
self
.
dialog
.
title
(),
'About IDLE'
)
def
test_dialog_logo
(
self
):
"""Test about dialog logo."""
path
,
file
=
os
.
path
.
split
(
self
.
dialog
.
icon_image
[
'file'
])
fn
,
ext
=
os
.
path
.
splitext
(
file
)
self
.
assertEqual
(
fn
,
'idle_48'
)
def
test_printer_buttons
(
self
):
"""Test buttons whose commands use printer function."""
dialog
=
self
.
dialog
...
...
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