Testing GTK4 installed on /opt/gtk -- some programs can not load their settings

Some days ago I installed test version of GTK4 as described at

https://developer.gnome.org/gtk4/3.96/gtk-building.html

While gtk4-demo works mostly fine, and I can compile and run plain C test programs, parts of gtk4.demo and whole gtk4-widget-factory refuse to run with messages like

$ gtk4-widget-factory
(gtk4-widget-factory:2245): GLib-GIO-ERROR **: 07:25:33.489: Settings schema
‘org.gtk.gtk4.Settings.ColorChooser’ is not installed

So I wonder if there is a trick to make gtk4 find it settings.

Hi!

Glib library is loaded from /usr/bin because is not found under /opt/gtk/lib. The system Glib library searches for gsettings schemas under usr/share/glib-2.0/schemas.

So you can use the GSETTINGS_SCHEMA_DIR environment variable to point to the /opt/gtk/share/glib-2.0/schemas directory:

GSETTINGS_SCHEMA_DIR=/opt/gtk/share/glib-2.0/schemas /opt/gtk/bin/gtk4-demo

That should work! Anyway I suggest using jhbuild or buildstream for parallel installations, so you know that everything is set up correctly.

So you can use the GSETTINGS_SCHEMA_DIR environment variable

Thanks for that information, will test it this evening.

From ‘man glib-compile-schemas’ I learned about XDG_DATA_DIRS environment variable but got it not working.

I suggest using jhbuild or buildstream for parallel installations,

Seem that was not mentioned at

https://developer.gnome.org/gtk4/3.96/gtk-building.html

Will try that, thank.

Alright, let me know if you get any problem.

Works fine with GSETTINGS_SCHEMA_DIR environment variable set :slight_smile:

With knowing that name, I also found a blog post with explanations:

https://blog.gtk.org/2017/05/01/first-steps-with-gsettings/

Will read more about jhbuild and buildstream soon…

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.