Re: Gtk::Image location



On Sat, 18 Jul 2009 11:43:28 -0400
xp <xjpeng buffalo gmail com> wrote:

> Thanks for reply.
> 
> Yes, what I want is to catch the signal of mouse motion. Actually, I
> also used Gtk::EventBox. The problem is although I can catch the mouse
> motion event, the event->x and event->y is for ScrollWindow, but what
> I want is those coordinates to image.
> 
> So I want to know the origin coordinate of image respect to
> scrollwindow. Or is there any other way to get the coordinates of
> image?

If you call Gtk::Widget::get_pointer() in the motion notify callback
for the event box, that will provide the pointer position in widget
(event box/image) co-ordinates rather than GDK/X co-ordinates, which
looks as if it is what you want.

Chris



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