Tutorials Application Resources

There are 3 tutorials in https://developer.puri.sm/Librem5/Apps/Tutorials.
I needed much time, to learn the tutorial “Application Resources”. Then I tried to use also a text file instead of a picture as Resource file. But I found no function like Gtk.Image.new_from_resource() to open and use the text file. After a lot of searching I found:

Warning In GTK+ 3.0, resource files have been deprecated …

Maybe the tutorial should be exchanged, with a more useful tutorial. But I am only a Gtk beginner. Are Application Resources really deprecated ?

As a GTK beginner, I didn’t notice that resource files were deprecated when I wrote the tutorials. :frowning_face:

Looking at the documentation for gtk_image_new_from_resource, it says that it was introduced in GTK 3.4, so it seems unlikely that resource files were deprecated in 3.0. Where did you see the warning?

The GTK documentation suggests using GtkCssProvider instead, which I tried to cover in an example. That example uses GResource.

1 Like

https://developer.gnome.org/gtk3/stable/gtk3-Resource-Files.html

In GTK+ 3.0, resource files have been deprecated and replaced by CSS-like style sheets, which are understood by GtkCssProvider.

Take with a grain of salt as I am a GTK pre-beginner. :wink:

1 Like

I went searching and found that page, too. Initially, I thought that the warning was for just those functions, but it seems pretty general. Who knows? :roll_eyes:

Having said that, see this thread on the GNOME Discourse which recommends using the equivalent of Gtk.Image.new_from_resource().

So, I guess it’s fine to use resources, though someone can feel free to correct me if I’m wrong. :smile:

2 Likes