触发pygtk中按钮的悬停事件的功能(triggering a function on hover event for button in pygtk)

编程入门 行业动态 更新时间:2024-10-27 09:32:19
触发pygtk中按钮的悬停事件的功能(triggering a function on hover event for button in pygtk) python

我想在鼠标悬停在按钮上时更改按钮的文字,

喜欢这个http://www.youtube.com/watch?v=l7vCf_lvUsY

如何在鼠标悬停在pygtk中的按钮上时添加事件

我在文档中找到了这个

I want to change the text of the button when mouse hovers on it,

Like this one http://www.youtube.com/watch?v=l7vCf_lvUsY

How to add an event when mouse hovers on a button in pygtk

I cudnt find this in the documentation

最满意答案

您将要连接到按钮的enter-notify-event和leave-notify-event信号。 不要忘记在事件掩码中启用它们。 我认为你不需要EventBox 。

You'll want to connect to the enter-notify-event and leave-notify-event signals of the button. Don't forget to enable them in the event mask. I don't think you need an EventBox.

更多推荐

本文发布于:2023-07-26 19:50:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1280251.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   事件   功能   pygtk   triggering

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!