[英]i want my tool stay display on desktop even if i click on browser or other program
i made a simple Tool with Tkinter , and i want this tool to stay display on desktop even if i click on browser or other program,so i want the tool always stay on front until i click minimize.我用Tkinter制作了一个简单的工具,即使我点击浏览器或其他程序,我希望这个工具保持显示在桌面上,所以我希望该工具始终保持在前面,直到我点击最小化。 thank you.谢谢你。
import pyautogui as p
import time
import tkinter
from tkinter import ttk
from tkinter import *
top = Tk()
top.title("past")
def brk():
#from dofus-map.com
time.sleep(0.2)
p.moveTo(238,627)
p.tripleClick()
p.hotkey('ctrl','c')
#from website
time.sleep(0.1)
p.moveTo(84,742)
p.tripleClick()
p.hotkey('ctrl','v')
#to game
time.sleep(0.1)
p.click(88,801)
p.tripleClick()
but = Button(text="past",width = 6, height = 3, font = ("blood",15,""), bg = "lightgreen", fg = "black" , command=brk)
but.pack()
top.mainloop()
Try using this尝试使用这个
top.attributes("-topmost", True)
This will always keep your window on top of the screen, regardless of what other programs you use.这将使您的 window 始终保持在屏幕顶部,无论您使用什么其他程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.