Device_Manager and mouse.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Device_Manager and mouse.

Pascal-68
Hello,

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).

Some clues are in below but gdk-device_manager.ads is not present :-(
gdk-device.ads:
--  See the Gdk.Device_Manager.Gdk_Device_Manager documentation for more
--  information about the various kinds of master and slave devices, and their
--  relationships.

and also below but no binding :-(
gdk-display.ads:
--  No binding needed (too low-level):
--  No binding: gdk_display_get_core_pointer
--  No binding: gdk_display_list_devices

If it is ”too low-level”, how can I get the device of the pointer otherwise?

Thanks, Pascal.
http://blady.pagesperso-orange.fr


_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada
Reply | Threaded
Open this post in threaded view
|

Re: Device_Manager and mouse.

Emmanuel Briot
> 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
_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada