- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to put a Tkinter window on top of the others?
Whenever we create a GUI program, tkinter generally presents the output screen in the background. In other words, tkinter displays the program window behind other programs. In order to put the tkinter window on top of others, we are required to use attributes('- topmost',True) property. It pulls up the window on the upside.
Example
#Importing the library from tkinter import * #Create an instance of tkinter window or frame win= Tk() #Setting the geometry of window win.geometry("600x350") #Create a Label Label(win, text= "Hello World! ",font=('Helvetica bold', 15)).pack(pady=20) #Make the window jump above all win.attributes('-topmost',True) win.mainloop()
Output
Running the above code will make the window stay on top all other windows −
- Related Articles
- How to put a Toplevel window in front of the main window in Tkinter?
- Forcing Tkinter window to stay on top of fullscreen in Windows 10?
- How to center a window on the screen in Tkinter?
- How to put an outline on a canvas text on Tkinter?
- How to keep the window focus on the new Toplevel() window in Tkinter?
- Tkinter - How to put an outline on a canvas text
- How do I position the buttons on a Tkinter window?
- Removing the TK icon on a Tkinter window
- Tkinter-How to get the current date to display in a tkinter window?
- How to take a screenshot of the window using Python?(Tkinter)
- How to make a Tkinter window jump to the front?
- How to bind the Enter key to a tkinter window?
- How to add a margin to a tkinter window?
- How to make a Tkinter window not resizable?
- How to delete Tkinter widgets from a window?

Advertisements