简体   繁体   English

即使我点击浏览器或其他程序,我也希望我的工具保持显示在桌面上

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

相关问题 我制作了一个显示时间的 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 如何在我的桌面(Windows 7)上使用python程序在我的桌面上显示简单的通知,而无需notify2,notify-send,pqt5? - How can I use my python program on my desktop (windows 7) to display a simple notification on my desktop without notify2, notify-send, pqt5? 我的程序没有打印出我想要的消息 - My program is not printing out the message I want 我想在程序中添加倒数计时器 - I want to add a countdown timer to my program 我想在我的模板上显示图像 - I want to Display the image on my template 如何将我的 python gui 程序存储为桌面应用程序? - how can i store my python gui program as desktop app? Python:如果出现错误,我想留在脚本中 - Python: if error raised I want to stay in script 我想知道为什么我的程序没有在我的 while 循环中停止 - I want to know why my program is not stopping in my while loop 我想编写一个在python / pygame中显示原始输入的框 - I want to program a box that will display raw input in python/pygame 我想在我的电脑启动时运行我的程序 - I want to run my program while my pc start
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM