Re: GLib doesn't find the ui resource
- From: Emmanuele Bassi <ebassi gmail com>
- To: Sascha Manns <Sascha Manns mailbox org>
- Cc: ML-gtk <gtk-list gnome org>
- Subject: Re: GLib doesn't find the ui resource
- Date: Wed, 30 Aug 2017 16:42:12 +0100
On 30 August 2017 at 14:48, Sascha Manns <Sascha Manns mailbox org> wrote:
Hello list,
i have written some ui files which are compiled through make [1]. I
installed the compiled file in /usr/share/gnome-publisher.
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 will load the bundle and register it.
Ciao,
Emmanuele.
--
https://www.bassi.io
[@] ebassi [@gmail.com]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]