Re: problem handling "mouse button press"
- From: Havoc Pennington <hp redhat com>
- To: Simon Hookway <lord_seoman hotmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: problem handling "mouse button press"
- Date: 19 Mar 2002 09:16:31 -0500
Simon Hookway <lord_seoman hotmail com> writes:
hmm, i'm now using gtk2, i have a pixmap that i rendered into an
eventbox as a GtkImage. I then render each button from a pixbuf onto
certain portions of the GtkImage to create the buttons. ATM, when i get
a click or release event i use gdk_window_get_pointer and test to see if
the pointer is in the button area. This creates a problem if the button
is irregular in shape.
But because my buttons are still in a pixbuf, i could test the alpha
channel of the original using the pointer location returned from the
gdk_window_get_pointer call (accounting for the offset of course).
Is there a better way to do this?
I don't think so, no. You don't need the get_pointer(), can just use
event->x, event->y (probably _should_ use them to avoid race
conditions).
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]