Re: problem handling "mouse button press"



Simon Hookway <lord_seoman hotmail com> writes:
Actually, i found that the eventbox has the button_press and
button_release masks set as default.


Good, convenient.
 
The next problem is this will catch the button press anywhere on the
pixmap.

Hmm. Would be easier if you were using GdkPixbuf/GtkImage from GTK 2. 
Then you could just check the value of the alpha channel at the
clicked pixel.

With GTK 1.2, you will need to gdk_image_get_from_drawable() the mask
for the pixmap, then gdk_image_get_pixel() the pixel at the place
where the user clicked.

You only need to get_from_drawable() a 1x1 area where the user
clicked, so should be pretty fast. Don't get the whole bitmap.

Havoc



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