当前位置: 技术问答>linux和unix
gtk中的鼠标事件处理?
来源: 互联网 发布时间:2016-04-15
本文导语: 我如果有个一个widget 像让当鼠标移动到某一个块在这个widget上的一个特定区域的时候触发一个事件 应该用什么事件怎么用的? | 鼠标经过时 "motion-notify-event" gboolean u...
我如果有个一个widget 像让当鼠标移动到某一个块在这个widget上的一个特定区域的时候触发一个事件 应该用什么事件怎么用的?
|
鼠标经过时
鼠标离开时
"motion-notify-event"
gboolean user_function (GtkWidget *widget,
GdkEventMotion *event,
gpointer user_data);
鼠标离开时
"leave-notify-event"
gboolean user_function (GtkWidget *widget,
GdkEventCrossing *event,
gpointer user_data);
|
you can check the position when your mouse move.
when it equal your before setting,make it be active!
or using "event box" component,you add it at the position that you need.
I can't try,just my opinion,you can try it~~
Good luck!
when it equal your before setting,make it be active!
or using "event box" component,you add it at the position that you need.
I can't try,just my opinion,you can try it~~
Good luck!