如何让点击事件通过 tkinter 窗口? [英] How to make click events pass though a tkinter window?

查看:44
本文介绍了如何让点击事件通过 tkinter 窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 tkinter 来制作叠加层,这样一些信息就会出现在屏幕的其余部分.

I have been playing with using tkinter to make overlays so some information would appear on top of the rest of the screen.

我不想让这个窗口挡住鼠标.有什么办法可以让点击事件通过我的叠加层吗?因此,我的 tkinter 应用程序下方的窗口会接收该事件.

I'd rather not have this window block the mouse. Is there any way I can have it so click events pass though my overlay? So the window below my tkinter app receives the event.

推荐答案

不,tkinter 没有内置任何内容可以让您这样做.最好的办法是捕获事件,然后使用某种特定于平台的工具来创建新事件,并使用捕获事件的坐标生成新的非 tkinter 事件.

No, there is nothing built in to tkinter that would allow you to do that. The best that you could hope for is to capture an event, then use some sort of platform-specific tool that lets you create new events, and use the coordinates from the captured event to generate a new, non-tkinter event.

这篇关于如何让点击事件通过 tkinter 窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆