简体   繁体   中英

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

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM