我使用tkinter
来制作gui,其中-topmost
和overrideredirect
为True。
我不想在任务栏中显示它的图标。我尝试过使用state
函数,但它不适合这样做。我的代码:
from tkinter import Tk
def dragwin(event):
x = root.winfo_pointerx() - _offsetx
y = root.winfo_pointery() - _offsety
root.geometry(f"+{x}+{y}")
def clickwin(event):
global _offsetx, _offsety
_offsetx = event.x
_offsety = event.y
root = Tk()
root.overrideredirect(1)
root.attributes("-topmost", True)
root.configure(background="black")
root.attributes('-alpha', 0.7)
# For motion of Window
root.bind('<Button-1>', clickwin)
root.bind('<B1-Motion>', dragwin)
root.mainloop()
我正在使用python 3.8.5和Visual Studio代码
所有代码建议将不胜感激。
谢谢
实际上,我正在使用powershell尝试代码,在那个阶段,我发现即使在OverrideDirect为true之后,它仍会在任务栏中显示图标,即使我再次运行OverrideDirect,它也会显示图标。 我想是匿名的
相关问题 更多 >
编程相关推荐