[Glade-users] Two newbie questions



Sorry for bringing this month-old thread up again. I just did not get  
to it earlier. Anyway, here are my two cents.

Ma Xiaojun wrote:
1. Where is the correct location to install .glade/.ui files with
regard to FHS or some freedesktop.org standards?

and:
On Sun, Apr 7, 2013 at 7:23 PM, Tristan Van Berkom
<tristan.van.berkom at gmail.com> wrote:
Rather, I would encourage you to use GResources to bind
the XML into your app or library and use  
gtk_builder_add_from_resource().
(note that GResources allows for a compression option too).

This is available since GTK+ 3.4, I'm on GTK+ 2.24 though.

First, I am very grateful for the hint to GResources. I wonder if  
embedding the glade files in the binaries would somehow allow for an  
easier way of UI localisation (i. e. translation of strings). On the  
first glance it appears that one would still have to maintain separate  
glade files for every supported language, just that they wouldn't all  
have to be installed in the file sytem, but in the executables (which  
might not be a good thing, as the executables would grow bigger with  
every supported translation). I may be missing something.       

Second, for installation in the file system, the right place for glade  
files is probably the one specified in the $XDG_DATA_DIRS environment  
variable*, usually /usr/share. There is a Glib utility function to get  
the right directories, so they do not need to be hard-coded. In gtkmm,  
it is called Glib::get_system_data_dirs(), don't know about GTK+.
* http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

There is also this four year old video explaining a way to embed glade  
files in executables:
http://www.youtube.com/watch?v=5-8h6eOwKwA
I don't know if this way is any good. On 2 Aug 2011 the above quoted  
Tristan Van Berkom had this to say about it:
?Sure you can do that, unfortunately it means any graphic files in the  
Glade file need to be specified by full path, because GtkBuilder  
currently only uses the file load location to resolve relative paths  
for loaded resources (something that could/should be easily fixed in  
GtkBuilder).?
(http://lists.ximian.com/pipermail/glade-users/2011-August/005355.html)

Carlos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.ximian.com/pipermail/glade-users/attachments/20130516/61d05004/attachment.pgp>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]