Re: mouse motion events



Thanks !
getting the the Gtk::Viewport with Gtk::ScrolledWindwow.get_child()
did the trick. Then i only need to pass Gdk::POINTER_MOTION_MASK
to its add_event(). So essentially, this is what i have to do to get the
coordinates of the scrolled image (i.e. the viewport containing the image):

   Widget *pw = m_scrollWin.get_child();
   pw->add_events( Gdk::POINTER_MOTION_MASK);
   m_scrollWin.signal_motion_notify_event().connect(sigc::mem_fun(*this,
&st::motion_action));

Jody

On Thu, May 29, 2008 at 7:25 PM,  <smso graduate hku hk> wrote:
> I think you may try:
>
> (1)
>        ...signal_motion_notify_event().connect
>        (
>                sigc::mem_fun(*this, &stest::motion_action),
>                false // after = false
>        );
>
>
> (2)
>        ...add_events
>        (
>                Gdk::EXPOSURE_MASK
>                | Gdk::POINTER_MOTION_MASK
>                | Gdk::BUTTON_PRESS_MASK
>                | Gdk::BUTTON_RELEASE_MASK
>                | Gdk::BUTTON_MOTION_MASK
>                | Gdk::POINTER_MOTION_HINT_MASK
>                | Gdk::ENTER_NOTIFY_MASK
>                | Gdk::LEAVE_NOTIFY_MASK
>        );
>
> (3)
>
> If a widget which doesn't have native scrolling capability
> is added to the Gtk::ScrolledWindow,
> it is placed in the Gtk::Viewport of the Gtk::ScrolledWindow.
>
> So you may try (1) and (2) above with the Gtk::Viewport.
>
>
> Blind guess only!
> Best regards.
>
>
>
>


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