[Python-checkins] cpython (3.3): Issue #20406: Use Python application icons for Idle window title bars.

terry.reedy python-checkins at python.org
Sat Feb 8 15:05:55 CET 2014


http://hg.python.org/cpython/rev/bda1739215b4
changeset:   89048:bda1739215b4
branch:      3.3
parent:      89045:19ca11099f07
user:        Terry Jan Reedy <tjreedy at udel.edu>
date:        Sat Feb 08 09:02:26 2014 -0500
summary:
  Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.

files:
  Lib/idlelib/Icons/idle.ico    |  Bin 
  Lib/idlelib/Icons/idle_16.gif |  Bin 
  Lib/idlelib/Icons/idle_16.png |  Bin 
  Lib/idlelib/Icons/idle_32.gif |  Bin 
  Lib/idlelib/Icons/idle_32.png |  Bin 
  Lib/idlelib/Icons/idle_48.gif |  Bin 
  Lib/idlelib/Icons/idle_48.png |  Bin 
  Lib/idlelib/PyShell.py        |   14 +++++++++++++-
  Misc/NEWS                     |    3 +++
  9 files changed, 16 insertions(+), 1 deletions(-)


diff --git a/Lib/idlelib/Icons/idle.ico b/Lib/idlelib/Icons/idle.ico
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..3357aef14888c501bcd7bfe02393760306a18d06
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_16.gif b/Lib/idlelib/Icons/idle_16.gif
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9f001b1d79cf697bb81bde59a5bc2f8341f74ba6
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_16.png b/Lib/idlelib/Icons/idle_16.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6abde0af90cb6bc9dfc71cc4d8fd17abc3c7bf53
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_32.gif b/Lib/idlelib/Icons/idle_32.gif
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..af5b2d52cce8951a47ac1604b9332b9032c0ce2d
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_32.png b/Lib/idlelib/Icons/idle_32.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..41b70dbc37766a9f229f4e0b88ddc2f13d22e3db
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_48.gif b/Lib/idlelib/Icons/idle_48.gif
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fc5304f31eed32d5f7769e471c3817b58edc10e4
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/Icons/idle_48.png b/Lib/idlelib/Icons/idle_48.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e5fa9280e21f86b0e5e750b02279b93e36009589
GIT binary patch
[stripped]
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -16,7 +16,7 @@
 
 import linecache
 from code import InteractiveInterpreter
-from platform import python_version
+from platform import python_version, system
 
 try:
     from tkinter import *
@@ -1524,6 +1524,18 @@
     # start editor and/or shell windows:
     root = Tk(className="Idle")
 
+    # set application icon
+    icondir = os.path.join(os.path.dirname(__file__), 'Icons')
+    if system() == 'Windows':
+        iconfile = os.path.join(icondir, 'idle.ico')
+        root.wm_iconbitmap(default=iconfile)
+    elif TkVersion >= 8.5:
+        ext = '.png' if TkVersion >= 8.6 else '.gif'
+        iconfiles = [os.path.join(icondir, 'idle_%d%s' % (size, ext))
+                     for size in (16, 32, 48)]
+        icons = [PhotoImage(file=iconfile) for iconfile in iconfiles]
+        root.wm_iconphoto(True, *icons)
+
     fixwordbreaks(root)
     root.withdraw()
     flist = PyShellFileList(root)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -316,6 +316,9 @@
 IDLE
 ----
 
+- Issue #20406: Use Python application icons for Idle window title bars.
+  Patch mostly by Serhiy Storchaka.
+
 - Update the python.gif icon for the Idle classbrowser and pathbowser
   from the old green snake to the new new blue and yellow snakes.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list