Skip to content

Commit 4ade2d2

Browse files
committed
Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.
1 parent 79b6f17 commit 4ade2d2

File tree

9 files changed

+16
-1
lines changed

9 files changed

+16
-1
lines changed

Lib/idlelib/Icons/idle.ico

19.3 KB
Binary file not shown.

Lib/idlelib/Icons/idle_16.gif

1.01 KB
Loading

Lib/idlelib/Icons/idle_16.png

1.23 KB
Loading

Lib/idlelib/Icons/idle_32.gif

1.4 KB
Loading

Lib/idlelib/Icons/idle_32.png

2.48 KB
Loading

Lib/idlelib/Icons/idle_48.gif

1.36 KB
Loading

Lib/idlelib/Icons/idle_48.png

4.6 KB
Loading

Lib/idlelib/PyShell.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import linecache
1717
from code import InteractiveInterpreter
18-
from platform import python_version
18+
from platform import python_version, system
1919

2020
try:
2121
from Tkinter import *
@@ -1536,6 +1536,18 @@ def main():
15361536
# start editor and/or shell windows:
15371537
root = Tk(className="Idle")
15381538

1539+
# set application icon
1540+
icondir = os.path.join(os.path.dirname(__file__), 'Icons')
1541+
if system() == 'Windows':
1542+
iconfile = os.path.join(icondir, 'idle.ico')
1543+
root.wm_iconbitmap(default=iconfile)
1544+
elif TkVersion >= 8.5:
1545+
ext = '.png' if TkVersion >= 8.6 else '.gif'
1546+
iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
1547+
for size in (16, 32, 48)]
1548+
icons = [PhotoImage(file=iconfile) for iconfile in iconfiles]
1549+
root.tk.call('wm', 'iconphoto', str(root), "-default", *icons)
1550+
15391551
fixwordbreaks(root)
15401552
root.withdraw()
15411553
flist = PyShellFileList(root)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ Tools/Demos
211211
IDLE
212212
----
213213

214+
- Issue #20406: Use Python application icons for Idle window title bars.
215+
Patch mostly by Serhiy Storchaka.
216+
214217
- Issue #17721: Remove non-functional configuration dialog help button until we
215218
make it actually gives some help when clicked. Patch by Guilherme Simões.
216219

0 commit comments

Comments
 (0)