views:

166

answers:

1

Hello,

how do I get the x/y-coordinates of a left click in a Gtk StatusIcon?

This is my first GTK app and I'm stuck. Is there any way to get details about the last button event that occurred? Or is it possible to pass those details to the handler function when connect()ing the "activate" callback?

Greets, Philip

+1  A: 

Since the status icon isn't a widget, it's a bit roundabout. You might be able to pass in some kind of widget as part of the user parameter object and get the global mouse position on activate. See here on how you might.

SB
Thank you very much, this is exactly what I've been looking for. For future reference, the following code resembles the idea in Python: x, y, mods = myStatusIcon.get_screen().get_root_window().get_pointer()
Philip