Is there a way to change the icon of a tkinter message box? Here is my code:
from tkinter import *
import tkinter.messagebox as messagebox
root = Tk()
mess
Yes, there is such an option. Assuming your root Tkinter instance is called root
, your import statement is from tkinter import *
, and your image file is named 'ico.gif'
:
root.tk.call('wm', 'iconphoto', root._w, PhotoImage(file='ico.gif'))
Call this method after creating the root
object and before popping the messagebox
. The icon will apply to the root object as well as to the messagebox
.