Re: GLib doesn't find the ui resource

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

 



Hi Emanuelle,

On 30.08.2017 17:42, Emmanuele Bassi wrote:
> On 30 August 2017 at 14:48, Sascha Manns <Sascha.Manns@xxxxxxxxxxx> wrote:
>> Also i used this lines to add stuff from the resource:
>> builder = Gtk.Builder()
>>
>> builder.add_from_resource("/org/gnome/Publisher/ui/main_intro.ui") [2]
> 
> Did you remember to load the GResource bundle you installed under your
> datadir, when you start your Python application?
> 
> C libraries and applications can take advantage of constructor
> functions called before main(), and the ability to embed the resources
> into the binary; Python (and other languages) do not have support for
> that, so you need to explicitly load the GResource.
> 
> In Python, you can use:
> 
> ```
> from gi.repository import Gio
> 
> datadir = ... # Set this one up from your configuration
> resource = Gio.Resource.load(os.path.join(datadir, 'gnome-publisher',
> 'gnome-publisher.gresource'))
> resoures.register()
This tip works perfectly.

Thank you.

-- 
Sascha Manns
Maifeldstraße 10
56727 Mayen

P: +49-2651-4014045
W: http://saigkill.tuxfamily.org

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux