

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Removing the TK icon on a Tkinter window
Tkinter initially displays a window that contains all the widgets and components. When we look on the Tkinter Menubar, it displays some "leaf" default icon for every Tkinter application. In order to change the default icon of the Tkinter window, we can use iconbitmap("icon location") method. It takes the location of the icon file and displays the window with a particular icon.
Example
In this python script, we have created an icon and used it for the output window.
#Import tkinter library from tkinter import * #Create an instance of tkinter frame or window win= Tk() #Set the geometry of tkinter frame win.geometry("750x250") #Change the icon of window taskbar win.iconbitmap("favicon.ico") #Create a Label Label(win, text="Transparent Icon Window", font=('Lucida 15')).pack() win.mainloop()
Output
Running the above code will display a window that has a customized Icon on the MenuBar.
- Related Questions & Answers
- How to center a window on the screen in Tkinter?
- How do I position the buttons on a Tkinter window?
- How to keep the window focus on the new Toplevel() window in Tkinter?
- How to put a Tkinter window on top of the others?
- Display the Host Name and IP Address on a Tkinter Window
- Difference between import tkinter as tk and from tkinter import
- Using a Frame class in a Tk class in Python tkinter
- Placing plot on Tkinter main window in Python
- How to remove the icon from the title bar in Tkinter?
- What's the difference between Tkinter's Tk and Toplevel classes?
- How to create a System Tray icon of a Tkinter application?
- Function to close the window in Tkinter
- Creating a Transparent window in Python Tkinter
- Creating a Frameless window in Python Tkinter
- How do I close a tkinter window?
Advertisements