Reputation: 349
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
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
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)
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