0

This is what I do to assign an icon shown in 'Alt-Tab' list to my python script.

   self.icon = tk.PhotoImage(file=iconpath)
   self.root.tk.call('wm', 'iconphoto', self.root._w, self.icon)

But it only works with .gif, which can't handle antialiasing for transparency correctly.

The same .ico file I created my .gif from looks perfect when assigned to .bat file for example.

Is there a way to make the .py script look not so much worse than .bat script in alt-tab menu?

Antony Hatchkins
  • 31,947
  • 10
  • 111
  • 111

1 Answers1

0
    self.root.iconbitmap(iconpath)

solved the issue (it accepts .ico - under Windows at least)

Antony Hatchkins
  • 31,947
  • 10
  • 111
  • 111