Directgui hover events and window edges

So I’m using button.bind(DGG.WITHOUT, self.unhover) to control the text colour of a directbutton, along with calling a method to change a rollover text window.

It works fine, except in the edge case of when the user flicks the mouse away from the panda3d window without landing on any non-button bits of it first. self.unhover is never called, and the button stays in its hovered state until the state is changed in some other way like being re-unhovered.

Is there any way to stop this happening?

Hmm, that does sound pretty annoying. I guess you could write a task that would check base.mouseWatcherNode.hasMouse() every frame, and do the appropriate thing when it goes to False, but that’s a pretty clumsy solution.