Re: Mouse position on a pixmap
- From: Tara Milana <learfox twu net>
- To: Zhu Yong <yong_zhy hotmail com>
- Cc: gtk-list gnome org, gtk-app-devel-list gnome org
- Subject: Re: Mouse position on a pixmap
- Date: Tue, 6 Jan 2004 19:42:38 -0800
On 2004.01.06 10:05 Zhu Yong wrote:
Currently I have a gtk_pixmap, some maps are drawn on the pixmap. Now I
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
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
] [Thread Prev