Hello everyone,
I’m in the process of creating a GTK 4 language binding for PureBasic and for that I need to re-define constants, bitfields and structures then write an Import for all functions.
According to the documentation Gtk.Border the structure is incorrectly defined like this :
struct GtkBorder {
gint16 left;
gint16 right;
gint16 top;
gint16 bottom;
}
A simple C code to prove it :
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <glib.h>
typedef struct _GtkBorder2
{
gint16 left;
gint16 right;
gint16 top;
gint16 bottom;
} GtkBorder2;
typedef struct _GtkBorder3
{
gint32 left;
gint32 right;
gint32 top;
gint32 bottom;
} GtkBorder3;
int main (int argc, char *argv[])
{
printf("GtkBorder : %zu\n", sizeof(GtkBorder));
printf("GtkBorder2 : %zu\n", sizeof(GtkBorder2));
printf("GtkBorder3 : %zu\n", sizeof(GtkBorder3));
return 0;
}
The code above print :
GtkBorder : 16
GtkBorder2 : 8
GtkBorder3 : 16
I think the same error appear in the GTK 3 documentation as well.
Best regards