Vamoos
Vamoos

Reputation: 349

How is it possible to change the icon on the title bar?

I have a question.

How is it possible to change the icon on the title bar, on a tkinter window?

I've tried .iconbitmap(). but it doesn't seem to work.

Upvotes: 3

Views: 9513

Answers (2)

Mista
Mista

Reputation: 11

You Can Use An '.ico' File To Change The Title Icon.

Heres The Code

root.iconbitmap(r'E:\\Projects\\Applications\\Nex Calculator\\icon.ico')

The Result: The Icon Popped Up!

Upvotes: 1

Venya
Venya

Reputation: 198

https://stackoverflow.com/a/18538416/4577427

that answer works fine, I tested it with a .exe and it took the icon of the .exe (didn't have a .ico handy) tkinter_using_factorio_ico

from tkinter import *
root = Tk()

root.iconbitmap(r'C:\Program Files\Factorio\bin\x64\Factorio.exe')
root.mainloop()

it needs the whole path, not just a part

Upvotes: 6

Related Questions