[gtkada] Device_Manager and mouse.

Emmanuel Briot briot at adacore.com
Mon Jan 6 11:41:52 CET 2014


> With GTKAda 2.24, I’ve used Gdk.Window.Get_Pointer in order to get the pointer (mouse) position at any time (i.e. not in an event).
> This function is deprecated in GTKAda 3.4 with the useful tip: use Gdk.Window.Get_Device_Position instead.
> Ok but this latter one needs a new device parameter with type declared in gdk-device.ads and I can’t find out how to get the device from the mouse (without getting an event).

Querying the location of the mouse is generally a sign of bad coding, since of course this is highly
volatile data).
Instead, you should look at the event parameter which is sent along with most of the low-level
signals (button_press, button_release, motion_notify), and use the mouse coordinates from that
event.
This is also a lot more efficient


regards
Emmanuel


More information about the gtkada mailing list