-2

I've set the icon I want to use with root.iconbitmap( default='Test.ico') and the icon appears correctly in the Tkinter GUI, but it shows the 'Tkinter feather' logo in the Windows Taskbar. When I compile the python scripts with cx_freeze, the .exe file has the correct icon, but again, the icon in the Taskbar shows the feather. Is there any way to fix this? Thanks in advance.

P.S. I'm using Python 3.6.3

EDIT:

The tkinter window shows the correct icon, the issue is that the Taskbar shows the 'feather' icon. Task Manager shows the correct icon for some reason. Strangely enough, sometimes the Taskbar shows the correct icon after a while. I haven't been able to reproduce this as it seems to occur randomly.

aL_eX
  • 1,453
  • 2
  • 15
  • 30
  • 3
    Have you checked these two? https://stackoverflow.com/questions/22618156/how-to-replace-the-python-logo-in-a-tkinter-based-python-gui-app && https://stackoverflow.com/questions/14900510/changing-the-application-and-taskbar-icon-python-tkinter – Lafexlos Jan 06 '18 at 16:57
  • 1
    Please include a [mcve] in your question. – Bryan Oakley Jan 06 '18 at 17:41

2 Answers2

1

I used Inno Setup (http://www.jrsoftware.org/isinfo.php) to bundle the .exe with the relevant files. This fixed the icon not appearing, as well as reducing the download size for my application from 300MB to 70MB.

aL_eX
  • 1,453
  • 2
  • 15
  • 30
0

Try adding the full path of the icon file. It is because only your python script i.e in the same directory can find that icon file hence showing it on top of window but not in task manager.

something like this :

from tkinter import *
login=Tk()


login.iconbitmap(r'C:\Users\Desktop\PYTHON\GUI\cricket.ico')

This works for me

DARK_C0D3R
  • 2,075
  • 16
  • 21
  • 1
    The tkinter window shows the correct icon, the issue is that the Taskbar shows the 'feather' icon. Task Manager shows the correct icon for some reason. Strangely enough, sometimes the Taskbar shows the correct icon after a while. I haven't been able to reproduce this as it seems to occur randomly. – aL_eX Jan 09 '18 at 20:41
  • This worked fine for me: https://stackoverflow.com/a/34547834/8865579 import ctypes myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid) – DARK_C0D3R Jan 10 '18 at 02:45
  • I tried this, but unfortunately it didn't work. I found that using Inno Setup fixed the problem. Thanks for your help! – aL_eX Jan 10 '18 at 14:59
  • Yes, I have also used that but it doesn't strikes me ':) thatnks for reminding – DARK_C0D3R Jan 10 '18 at 16:41