Issue #20406: Use Python application icons for Idle window title bars.

Patch mostly by Serhiy Storchaka.
This commit is contained in:
Terry Jan Reedy 2014-02-08 09:39:51 -05:00
parent 79b6f17d70
commit 4ade2d25fc
9 changed files with 16 additions and 1 deletions

BIN
Lib/idlelib/Icons/idle.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -15,7 +15,7 @@ import io
import linecache
from code import InteractiveInterpreter
from platform import python_version
from platform import python_version, system
try:
from Tkinter import *
@ -1536,6 +1536,18 @@ def main():
# 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.tk.call('wm', 'iconphoto', str(root), "-default", *icons)
fixwordbreaks(root)
root.withdraw()
flist = PyShellFileList(root)

View File

@ -211,6 +211,9 @@ Tools/Demos
IDLE
----
- Issue #20406: Use Python application icons for Idle window title bars.
Patch mostly by Serhiy Storchaka.
- Issue #17721: Remove non-functional configuration dialog help button until we
make it actually gives some help when clicked. Patch by Guilherme Simões.