How to find out if mouse pointer in invisible window?

Hi all,

I have the following situation: I have a Gtk2::EventBox on which I want
to set a different image depending on whether the mouse is in it or not
 (without a mouse-motion event occurring). This works:



my $mouse_window = (Gtk2::Gdk::Window->at_pointer())[0];
my $box_window = $event_box->window();

if ($box_window == $mouse_window) {
        # the mouse is in my eventbox

However, when I set $eventbox->set_visible_window(FALSE), which is
actually what I want, then $event_box->window() returns the parent
window of the widget and not the actual window and the above code no
longer works.

Is there any way to do what I want on an event box with an invisible window?

Thanks in advance,
Sebastiaan van Erk

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]