Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7c07d3

Browse files
committed
Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.
1 parent 98585b6 commit a7c07d3

9 files changed

Lines changed: 16 additions & 1 deletion

File tree

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
@@ -16,7 +16,7 @@
1616

1717
import linecache
1818
from code import InteractiveInterpreter
19-
from platform import python_version
19+
from platform import python_version, system
2020

2121
try:
2222
from tkinter import *
@@ -1524,6 +1524,18 @@ def main():
15241524
# start editor and/or shell windows:
15251525
root = Tk(className="Idle")
15261526

1527+
# set application icon
1528+
icondir = os.path.join(os.path.dirname(__file__), 'Icons')
1529+
if system() == 'Windows':
1530+
iconfile = os.path.join(icondir, 'idle.ico')
1531+
root.wm_iconbitmap(default=iconfile)
1532+
elif TkVersion >= 8.5:
1533+
ext = '.png' if TkVersion >= 8.6 else '.gif'
1534+
iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
1535+
for size in (16, 32, 48)]
1536+
icons = [PhotoImage(file=iconfile) for iconfile in iconfiles]
1537+
root.wm_iconphoto(True, *icons)
1538+
15271539
fixwordbreaks(root)
15281540
root.withdraw()
15291541
flist = PyShellFileList(root)

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ Library
316316
IDLE
317317
----
318318

319+
- Issue #20406: Use Python application icons for Idle window title bars.
320+
Patch mostly by Serhiy Storchaka.
321+
319322
- Update the python.gif icon for the Idle classbrowser and pathbowser
320323
from the old green snake to the new new blue and yellow snakes.
321324

0 commit comments

Comments
 (0)