Hi Michalis,

On Sat, 2026-03-21 at 14:36 +0000, Michalis Kamburelis wrote:
> 5. I needed to change the gtk_widget_set_events call. See
> https://github.com/castle-engine/castle-engine/commit/e88fdb07fed6bfc4290280070e227e35211f3db6
>  . For some reason, in latest version I took from Lazarus GTK3
> bindings, this expects a Pascal set, while in fp-units-gtk3 this
> expects a simple integer. Of course binary it doesn't matter, it's
> the same thing for C. I don't know why there's a difference in how
> Pascal bindings define it (was the same version of git2pas used to
> generate them? which version used newer git2pas version?) and what is
> "more reliable in the future" -- I can adjust as needed to
> https://gitlab.com/gtk4pas/gtk3bindings changes, no problem :)
This looks a problem on GTK sources, not in gir2pas. Below is a snippet
from /usr/include/gtk-3.0/gtk/gtkwidget.h lines 968 to 981 .

GDK_AVAILABLE_IN_ALL
void       gtk_widget_set_events          (GtkWidget           *widget,
                                           gint                 events);
GDK_AVAILABLE_IN_ALL
void       gtk_widget_add_events          (GtkWidget           *widget,
                                           gint                 events);
GDK_AVAILABLE_IN_ALL
void       gtk_widget_set_device_events   (GtkWidget           *widget,
                                           GdkDevice           *device,
                                           GdkEventMask         events);
GDK_AVAILABLE_IN_ALL
void       gtk_widget_add_device_events   (GtkWidget           *widget,
                                           GdkDevice           *device,
                                           GdkEventMask         events);

As you can see, the functions gtk_widget_set_events and
gtk_widget_add_events use gint while the functions
gtk_widget_set_device_events and gtk_widget_add_device_events use
GdkEventMask.

As gir2pas does not have any information about the underlying type of
events, it can not use Pascal set type for events in the two upper
functions, but can do that for the two others.

This can only be solved by requesting a change on GTK sources.
-- 
Cheers,
Mazen Neifer
Debian Developer

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to