Reputation: 158
I'm making an app for elementary OS using Vala. I use a .glade file to define the interface and I load it in the app with:
this.builder = new Gtk.Builder ();
builder.add_from_file ("src/filename.glade");
It obviously only works when I run the program from the project folder (where there is src folder).
My question is, how do I correctly define the route to the .glade file in order to make the application work after installing it in the system using cmake? (the cmake file has been built following the elementary os guide).
To sum up:
Upvotes: 1
Views: 48
Reputation: 7153
You probably want to use GResources. In an extra build step, you compile your resource files, such as Glade, into C files that get included in the compilation process. Then, use new GtkBuilder.from_resource
to include the configuration. There are similar resource-based methods for images and files.
Upvotes: 2