[Glade-users] Click coordinates



I've got a problem posted by Tieum to the gtk-list, but there was no 
answer for that:

[Tieum]

  Hi,
I display a BMP  in a GtkImage itself in a GtkEventBox to get mouse click.
When I click in the BMP, I want to:
1?) know the color of the clicked pixel
2?) display something around there
For this purpose, I get a GdkPixbuf from GtkImage 
If the window is the size of BMP, everything is OK.
On the other way, if the window is bigger than the BMP (there's a gray part on 
the left), the coord I get for the mouse click from GdkEventButton.x and 
GdkEventButton.y has an offset corresponding to the width of the gray part.
How can I known the offset between the GtkEventBox (or the GtkImage) and the 
GdkPixbuf ?
   Thanks,
[/Tieum]


Could You help me with that? I can't still find any answer on the Internet.

Regards,
kappa




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