简体   繁体   English

我制作了一个显示时间的 tkinter 程序,即使我更改标签,我也希望它留在屏幕上,有什么办法可以做到这一点

[英]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.

相关问题 即使我点击浏览器或其他程序,我也希望我的工具保持显示在桌面上 - i want my tool stay display on desktop even if i click on browser or other program 我的缩进有问题,它使程序无响应 - I have a problem with my indentation and it's making the program unresponsive 我想在 tkinter 按钮中放置不同的命令(由 for() 制作) - I want to put different command in tkinter Button (made by for()) 有没有办法我可以使用 python 以某种方式拉出我在屏幕上打开的所有选项卡? 在 windows - Is there a way I can somehow pull all tabs I have open on my screen using python? On windows Tkinter 插入 function 始终将文本插入到同一行,即使我更改输入的行也是如此 - Tkinter insert function inserts text on to the same line all the time even when I change the line I input Tkinter程序更新屏幕,但我不明白如何在没有canvas.create命令的情况下 - Tkinter program updates screen but I dont understand how without any canvas.create commands EnumDisplayDevices 提供两个显示器,即使我有一个 - EnumDisplayDevices giving two Displays even though I have one 如果我有两个矩阵并且我想划分数据并希望在 Python 中保持相同的一致性(Nones 保持不变)? - If I have two matrices and I want to divide the data and want to keep the same consistency (the Nones stay where they are) in Python? 修复我用 tkinter 制作的工具栏 - fixing the toolbar i made with tkinter 我想在 tkinter 中制作的记事本左侧添加边距,但我不知道该怎么做? - I want to add margin to the left side of notepad I made in tkinter and I don't know how to do it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM