Missing GDK buttons definition?

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

Missing GDK buttons definition?

Qun-Ying
Hi,

While trying to follow a Gtk+ example into GtkAda:
http://goo.gl/WtTQqx

I found no definition for mouse buttons,
GDK_BUTTON_PRIMARY, GDK_BUTTON_SECONDARY,   GDK_BUTTON_MIDDLE, etc.

Which is used to compare with  the Button filed of Gdk.Event.Gdk_Event_Button.


Is it intentional or missing from the binding?


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

Re: Missing GDK buttons definition?

Emmanuel Briot
> I found no definition for mouse buttons,
> GDK_BUTTON_PRIMARY, GDK_BUTTON_SECONDARY,   GDK_BUTTON_MIDDLE, etc.

These are just three #define in C:

#define GDK_BUTTON_PRIMARY      (1)
#define GDK_BUTTON_MIDDLE       (2)
#define GDK_BUTTON_SECONDARY    (3)


So you can certainly declare Ada constants for these.

> Is it intentional or missing from the binding?


We don't in general bind macros, because they are in most cases C-specific (the ones
in glib) or inapplicable to Ada or require an intermediate C file in GtkAda.
These packages are also mostly automatically generated, so it is sometimes complex
to hack on the python script to do the generation.

I have however added those three constants to the development version of GtkAda.

regards
Emmanuel
_______________________________________________
gtkada mailing list
[hidden email]
http://lists.adacore.com/mailman/listinfo/gtkada