How do we get GTYPE from gobject introspection language bindings
- Date: Thu, 28 Sep 2017 22:33:02 +0200
- From: Stefan Salewski <mail@xxxxxxxxxxxx>
- Subject: How do we get GTYPE from gobject introspection language bindings
I am just preparing a listview example for the Nim GTK3 mini tutorial.
I followed the Z-Code C example. Was not too difficult. But I got one
problem: For working with listviews, we have to provide GTypes, which
are numerical values. For C we have the macros like G_TYPE_STRING which
for my box gives currently value 64. These values seems to be not
directly supported by gobject-introspection. Seems to be no big
problem, we may query the values by g-type-from-name().
For G_TYPE_STRING I assumed that name is "GSTRING" which gives indeed a
non zero result from g-type-from-name(). But it is wrong.
We can get the correct name by using g_type_name(G_TYPE_STRING). This
And indeed, when I provide this name to g-type-from-name() then the Nim
example works fine.
But where should high level users find the corresponding G_TYPE names
Or is there another way to get G_TYPE values? I assume a static list of
integers would not make much sense?
Maybe you know how this is done in other languages with GTK bindings.
gtk-list mailing list