[英]I have made a tkinter program that displays the time and i want it to stay on screen even if I change tabs is there any way of making thi s
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我在 Python 中制作了一个 Tkinter 程序,它显示时间,我希望它留在屏幕上,即使我更改标签有没有办法做到这一点
You can use the -topmost
attribute.您可以使用
-topmost
属性。 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()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.