pahnin
pahnin

Reputation: 5588

triggering a function on hover event for button in 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

Upvotes: 2

Views: 1615

Answers (2)

ptomato
ptomato

Reputation: 57854

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.

Upvotes: 5

Froyo
Froyo

Reputation: 18477

You can add a gtk.EventBox() of the size of the button and add button in it. And you can easily add an event for hovering.

Upvotes: 1

Related Questions