1

Not sure how to change the icon of a simple dialog window. I try to use .bitmap but doesn't work. Need Help

GCIreland
  • 145
  • 1
  • 16

2 Answers2

1

Just add the default keyword argument to the iconbitmap() for the icon of the root, then all the child windows will inherit the icon.

import tkinter
from tkinter import simpledialog

root = tkinter.Tk()
root.iconbitmap(default="C:\\Users\\username\\random.ico")

dialog = simpledialog.askstring("INFO", "wut ur name?")

root.mainloop()

Result with default:

Results without default:

Arib Muhtasim
  • 147
  • 2
  • 8
0

Are you looking for this

from tkinter import Tk
master = Tk()

photo = PhotoImage(file = "Any image file")
master.iconphoto(False, photo)
Utpal Kumar
  • 300
  • 2
  • 13