OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to set a window icon once in Tkinter for all dialogs including messagebox on Windows?

  • Thread starter Thread starter JoseAndresMoraila
  • Start date Start date
J

JoseAndresMoraila

Guest
On Linux using Tkinter and TtkBootstrap, you can set up a logo once with:

Code:
logo = tb.PhotoImage(file="images/favicon.png")
root.iconphoto(True, logo)

This ensures that the logo is shown on every Toplevel and in messagebox.showerror/info/warning dialogs.

However, on Windows, you have to use .iconbitmap('images/favicon.ico') for each Toplevel. Unfortunately, the icon does not appear in messagebox.showerror/info/warning dialogs,and it only appears the Tkinter logo or the Ttkbootstrap logo.

Is there any function in Tkinter where you can define the logo once on Windows, and more importantly, ensure that the logo appears in messagebox.showerror/info/warning dialogs?

I tried to find something by asking ChatGPT, but it doesn't know and there aren't any questions about that on the internet.
<p>On Linux using Tkinter and TtkBootstrap, you can set up a logo once with:</p>
<pre><code>logo = tb.PhotoImage(file="images/favicon.png")
root.iconphoto(True, logo)

</code></pre>
<p>This ensures that the logo is shown on every Toplevel and in messagebox.showerror/info/warning dialogs.</p>
<p>However, on Windows, you have to use <code>.iconbitmap('images/favicon.ico')</code> for each Toplevel. Unfortunately, the icon does not appear in messagebox.showerror/info/warning dialogs,and it only appears the Tkinter logo or the Ttkbootstrap logo.</p>
<p>Is there any function in Tkinter where you can define the logo once on Windows, and more importantly, ensure that the logo appears in messagebox.showerror/info/warning dialogs?</p>
<p>I tried to find something by asking ChatGPT, but it doesn't know and there aren't any questions about that on the internet.</p>
 

Latest posts

Top