GTK bindings

Linux specific forum
uwekel
Enthusiast
Enthusiast
Posts: 740
Joined: Sat Dec 03, 2011 5:54 pm
Location: Oldenburg (Germany)

GTK bindings

Post by uwekel »

Hi,

today i came across an error when loading a GTK stock icon with the internal GTK function

Code: Select all

gtk_icon_theme_load_icon_()
This works fine if the compiler option "Create Unicode executable" is not set. Otherwise you get no icon. After some further investigation, i found out that to get it work, i can either use an ASCII converted string or re-declare the GTK function with the pseudo type p-utf8 like this:

Code: Select all

gtk_icon_theme_load_icon(*theme, name.p-utf8, size, flags, *gerror)
I looked also to other GTK functions and found out that they also do not work either, so i guess that the whole bindings are only work in ASCII mode.

I am not sure whether it is really a bug, but by using the p-utf8 thing, the code works in ASCII and UNICODE mode.

Best regards
Uwe
PB 5.70 LTS (x64) - Debian Testing, Gnome 3.30.2
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Re: GTK bindings

Post by remi_meier »

Here: http://remi.secretly.de/downloads/gtk2.pbi
Search for gir2pb and my name to learn how to generate
such include files yourself.
You can either remove the gtk.res resident file or comment
some constants in the file above to make it compile.
Removing the residents is probably the simpler and more
correct way. Also, unfortunately I don't resolve dependencies
to work with forward declaration of PB. If PB says that
something is not declared, look further down in the file and
move it above the error-line.
This should work on Ubuntu 12.10.
Athlon64 3700+, 1024MB Ram, Radeon X1600
Post Reply