Kevin Nisbet
Kevin Nisbet

Reputation: 179

How can I change the windows icon of several levels in tkinter?

I have got the root window icon displaying fine but how could I set all window icons to be the same?

enter image description here

I was trying to do this but never worked:

levels = ("root_1", "root_2")
for i in levels:
    i.iconbitmap(file_name)

Would I have to set each level individually or is there a better way than?

root_1.iconbitmap(file_name)
root_2.iconbitmap(file_name)

Upvotes: 1

Views: 80

Answers (1)

Sanjit
Sanjit

Reputation: 33

To solve your problem, try this:

icons = [file_name_for_root_1, file_name_for_root_2]
levels = (root_1, root_2)
for i in levels:
    i.iconbitmap(icons[i])

Upvotes: 1

Related Questions