I have made a Tkinter program in Python that displays the time and I want it to stay on screen even if I change tabs is there any way of doing this
Asked
Active
Viewed 37 times
-5
-
1Do you mean you want to keep the tkinter window on top? – DapperDuck Jan 19 '21 at 14:04
-
1Does this answer your question? [How to put a tkinter window on top of the others?](https://stackoverflow.com/questions/8691655/how-to-put-a-tkinter-window-on-top-of-the-others) – Countour-Integral Jan 19 '21 at 14:06
-
[What if two programs did this?](https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413) – IInspectable Jan 19 '21 at 14:29
-
1Your questions is a copy of your title lacking detail and code. Please update your question to include example code and exactly what you need. IE Do you mean tabs within tkinter or tabbing applications within windows? – Mike - SMT Jan 19 '21 at 14:42
-
What I meant was like the taskbar which stays on screen no matter which tab you are in. Thanks to DapperDuck for his anwser it really helped – HAT1412 Jan 20 '21 at 06:58
1 Answers
0
You can use the -topmost
attribute. Here is the code:
root.attributes("-topmost", True)
Here is an example:
import tkinter as tk
root = tk.Tk()
tk.Label(root, text="Test").pack()
root.attributes("-topmost", True)
root.mainloop()

DapperDuck
- 2,728
- 1
- 9
- 21