wxpython按钮按下事件 [英] wxpython button held down event

查看:76
本文介绍了wxpython按钮按下事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在寻找一种在wxpython中捕获按钮按下事件的方法,我似乎什么也找不到.那里只是wx.EVT_BUTTON,这不是我想要的.只要按钮按下,我希望我的事件继续进行.任何帮助,将不胜感激谢谢詹姆斯

hey all, im looking for a way of catching a button held down event in wxpython i cant seem to find anything. theres just wx.EVT_BUTTON which isnt quite what i want. i want my event to continue processing as long as the button is down. any help would be appreciated thanks james

推荐答案

我想我会抓住EVT_LEFT_DOWN和EVT_LEFT_UP.然后启动一个wx.Timer在EVT_LEFT_DOWN上运行您的进程,直到EVT_LEFT_UP被触发.或者,您可以使用ToggleButton.

I think I would catch the EVT_LEFT_DOWN and the EVT_LEFT_UP. Then start a wx.Timer to run your process on EVT_LEFT_DOWN until the EVT_LEFT_UP is fired. Alternatively, you could use a ToggleButton.

这篇关于wxpython按钮按下事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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