[Pkg-pascal-devel] Bug#967284: Bug#967284: Using fp-units-gtk3 ( https://gitlab.com/gtk4pas/gtk3bindings ) for GTK 3 in Castle Game Engine

Mazen Neifer mazen at debian.org
Sun Mar 22 11:52:18 GMT 2026


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-pascal-devel/attachments/20260322/13a9c6c2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-pascal-devel/attachments/20260322/13a9c6c2/attachment.sig>


More information about the Pkg-pascal-devel mailing list