Window Icon in Tk (tkinter)
Both main windows (created via the tk.Tk
class) and child windows (tk.Toplevel
) have the Tcl/Tk logo icon by default. Setting custom window icons will give our application a more professional look. A window icon is also often displayed by the operating system on the taskbar or application bar. In this post we will see the various ways for configuring window icons on the different platforms supported by Tk (Windows, Linux and Mac).
Tk window objects provide three methods to set an icon:
iconbitmap()
iconmask()
iconphoto()