如何捕获事件框上的事件以检测gtk中的鼠标移动? [英] How to capture event on event box to detect mouse movement in gtk?
本文介绍了如何捕获事件框上的事件以检测gtk中的鼠标移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在,我在 event_box
上有一个 motion_notify_event
,用于跟踪鼠标坐标.仅当我单击 event_box
时,我才能检测到运动,是否有人知道鼠标悬停时如何捕获 event_box
上的事件,所以我不必点击它.谢谢.
Right now I have a motion_notify_event
on an event_box
to track mouse coordinates. I can detect motion only if I click on the event_box
does any one know how I can capture the event on the event_box
when the mouse is over so I don't have to click on it. Thanks.
推荐答案
我认为您想听"motion-notify-event"
信号.确保还启用了 GDK_POINTER_MOTION_MASK
标志.
I think you want to listen to the "motion-notify-event"
signal. Make sure you also enable the GDK_POINTER_MOTION_MASK
flag.
这篇关于如何捕获事件框上的事件以检测gtk中的鼠标移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文