Re: regarding GResource in Python
- From: "D.H. Bahr" <dbahr uci cu>
- To: gtk-devel-list gnome org
- Subject: Re: regarding GResource in Python
- Date: Fri, 28 Sep 2012 13:43:33 -0400
Actually.. sorry to everyone, I miss typed a letter on the resource
name..
my bad
Best regards
On Fri, 2012-09-28 at 13:08 -0400, D.H. Bahr wrote:
> Hello everyone!
>
> I'm not sure this is the right place but I hope that I'll get redirected
> if need be.
>
> I'm writing a Python2.7 + Gtk3 application and I'm trying to use
> GResource to store my .ui files and other data.
>
> How would this be done??
>
> I've already created the serere.gresource.xml file like this
>
> <?xml version="1.0" encoding="UTF-8"?>
> <gresources>
> <gresource prefix="/cu/nova/serere">
> <file compressed="true">gtk3/assistant.ui</file>
> </gresource>
> </gresources>
>
> Then I used the glib-compile-resources
>
> $ glib-compile-resources serere.gresource.xml
>
> That generated a file named serere.gresource
> On the code I did this:
>
> DATA_DIR = "data/"
> resource = Gio.resource_load(DATA_DIR + "serere.gresource")
> Gio.Resource._register(self.resource)
> ...
> builder = Gtk.Builder()
> builder.add_from_resource('/cu/nova/serere/gtk3/assistant.ui')
>
> when running the script the interpreter crashes with the message:
>
> gi._glib.GError: The resource at '/cu/nova/serere/gtk3/assistant.ui' does not exist
>
> So.. what am I not doing (right)?
>
> Best regards and lots of thanks in advance...
>
>
> 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
> CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION
>
> http://www.uci.cu
> http://www.facebook.com/universidad.uci
> http://www.flickr.com/photos/universidad_uci
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
>
> 10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
> CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION
>
> http://www.uci.cu
> http://www.facebook.com/universidad.uci
> http://www.flickr.com/photos/universidad_uci
10mo. ANIVERSARIO DE LA CREACION DE LA UNIVERSIDAD DE LAS CIENCIAS INFORMATICAS...
CONECTADOS AL FUTURO, CONECTADOS A LA REVOLUCION
http://www.uci.cu
http://www.facebook.com/universidad.uci
http://www.flickr.com/photos/universidad_uci
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]