Re: Mouse position on a pixmap

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

 



On 2004.01.06 10:05 Zhu Yong wrote:
> hi,
> 
> Currently I have a gtk_pixmap, some maps are drawn on the pixmap. Now I
> want 
> this function:
> when mouse is clicked inside the pixmap, a message(not message box, it's 
> more like a tooltip) will popup beside the mouse pointer to tell the
> current 
> position of mouse on the pixmap.

I'd recommend that you create a GtkEventBox or a GtkDrawingArea
and draw the GdkPixmap yourself. Set the GtkEventBox or
GtkDrawingArea's events to receive the "enter_notify_event"
and "motion_notify_event" to find out where the pointer is.

The tricky part is the tooltip, unfortunately the tooltip
will not appear next to the pointer. So you need to
create a tooltip widget yourself using a GtkWindow set
to GTK_WINDOW_POP.

--Tara

_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux