This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Tkinter taskbar icon (Windows)
Type: behavior Stage: resolved
Components: Tkinter, Windows Versions: Python 3.6
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: Minion Jim, paul.moore, serhiy.storchaka, steve.dower, terry.reedy, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2018-01-21 20:11 by Minion Jim, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
tkinter glitch.gif Minion Jim, 2018-01-27 17:34
Messages (8)
msg310382 - (view) Author: (Minion Jim) Date: 2018-01-21 20:11
When using Python version 3.6.4, Tkinter shows a blank icon on the taskbar. This means any Tkinter window including IDLE and a blank one. Unfortunately, I don't have a screenshot to show this as I reinstalled version 3.6.3 which works perfectly.
msg310792 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-01-26 21:10
On Win10, with 3.5.4, 3.6.4, 3.7.0a4, the pinned IDLE icons on my taskbar look normal, with the notebook and snake icon.  Running

import tkinter as tk
r = tk.Tk()

stacks the edge of a shadow icon behind the IDLE icon.  When I mouse over the pair, the tkinter icon expand to a box with tk feather icon and 'tk' on the top title line and a blank white box.  Adding

tk.Label(r, text='jsfjlskjflsjflksjflkjsflkjsfljsfljslfjfs').pack()

shrinks the window to fit the label and the expanded icon has a shrunken box also.  Everything looks normal to me.

What windows version are you using?  What exact code do you run to get the effect you describe?  Can you describe what you see better?
msg310854 - (view) Author: (Minion Jim) Date: 2018-01-27 11:14
Hi, thanks for your email. I hope to get round to sending you a screenshot by the end of today but I am quite busy right now.

Many thanks,
Elisha
________________________________
 Elisha Paine
Ranelagh School

Confidentiality and Disclaimer: This email and its attachments are intended for the addressee only and may be confidential or the subject of legal privilege. The views expressed in this email are those of the individual and not necessarily the views or opinions of Ranelagh School. If this email and its attachments have come to you in error you must notify the school network manager, and immediately delete them. Email: administrator@ranelagh.bracknell-forest.sch.uk. You should not copy, distribute or show them to anyone else. This email and any attached files have been scanned for the presence of computer viruses. However, you are advised that you open any attachments at your own risk. Please note that electronic mail may be monitored in accordance with the Telecommunications (Lawful Business Practices) (Interception of Communications) Regulations 2000
msg310872 - (view) Author: (Minion Jim) Date: 2018-01-27 17:34
Please see the attached gif for a demonstration (I am using Windows 10 Home)
msg310942 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-01-28 12:10
To fix this, we need to make Idle its own .exe file with an AppId and properly registered icon. Right now, it's just a .pyw file running in Python, and so things like pinning icons or file associations won't work cleanly.
msg310957 - (view) Author: (Minion Jim) Date: 2018-01-28 15:46
This isn't just IDLE. On the GIF, I also demonstrate other Tkinter windows which is why have been led to believe it is an underlying Tkinter problem rather than IDLE.
msg310994 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-01-28 21:09
Looking at the animated .gif, Jim's problem has nothing to do with IDLE in particular, and is as least partly specific to his system, as I do not have the same problem on my system.  (That does not mean that improvements are not possible, so that reboots are not needed after updates.)

If one runs a file with python.exe that does not exit immediately, the taskbar icon is the 'Python Console icon, a dark console with blue title bar and text and the Python double snake overlaid.  If on runs a file with pythonw.exe (no console) that does not exit immediately, the taskbar icon should be the 'Python GUI' icon, a spiral-bound notebook page with folded upper right corner and the Python double snake overlaid.  The expected use case is a GUI program, such as a tkinter program, that runs an event loop until closed.  IDLE is just the prime example of such. Another example is the test program for this issue.

import tkinter as tk
r = tk.Tk()
r.mainloop()

When I name this file tem.py or tem.pyw and double-click, I get the respective Python icons.

Jim, the 'blank' icon you see when you double-click *.pyw is a white sheet of paper with the upper right corner folded.  It is the first one shown when the builtin icons are displayed.  It is used when Windows cannot find the proper icon for an application (or perhaps also when there is None).

Some while ago, after an update, my pinned Skype icon visually changed from the blue blob with white S to this default.  Yesterday, I right-clicked the folded page icon, right-clicked 'Skype, selected Properties, and then [Change Icon] on the Shortcut tab.

An error box popped up with a message similar to "%SystemRoot%\Installer\{3B7E914A-93D5-4A29-92BB-AF8C3F66C431}\SkypeIcon.exe cannot be found". My guess is that an update changed the uuid without updating the pinned icon, so the default folded page is the substitute.  When I clicked 'OK', the Change Icon dialog appeared.  When I browsed to the Skype directory, I did not find an icon file, so I clicked on Skype.exe instead, and that worked, and I again have the Skype icon on my taskbar.

Jim, I suggest you try the same, except navigate to 3.6 pythonw.exe.  Running 'import sys; sys.executable' shows the location.  If pythonw.exe has the proper icon, I expect that this should work.
msg311285 - (view) Author: (Minion Jim) Date: 2018-01-30 17:22
Sorry for posting this as a bug :-( When I reupdated (again) it sorted itself out (for whatever reason). So once again sorry for wasting your time.
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76792
2018-02-02 04:06:48terry.reedysetstatus: open -> closed
resolution: works for me
stage: resolved
2018-01-30 17:22:20Minion Jimsetmessages: + msg311285
2018-01-28 21:09:42terry.reedysettype: enhancement -> behavior
messages: + msg310994
versions: + Python 3.6, - Python 3.8
2018-01-28 15:46:14Minion Jimsetmessages: + msg310957
2018-01-28 12:10:12steve.dowersettype: behavior -> enhancement
messages: + msg310942
versions: + Python 3.8, - Python 3.6
2018-01-27 17:34:35Minion Jimsetfiles: + tkinter glitch.gif

messages: + msg310872
2018-01-27 11:14:58Minion Jimsetmessages: + msg310854
2018-01-26 21:10:29terry.reedysetnosy: + terry.reedy, serhiy.storchaka
messages: + msg310792
components: + Tkinter
2018-01-21 20:11:31Minion Jimcreate