Glade on Windows using Python

M

mbg1708

Using Windows 8.1 Update.
I've loaded ActiveState python (version 2.7) --- installed OK.
I don't need Glade, but I do want to use some Glade XML and run the python application.
To run a Glade application this needs:

from gi.repository import Gtk

gi.repository is not available to import.

Where can I find gi.repository?....all searches to date have come up empty!

Mary
 
M

mbg1708

Using Windows 8.1 Update.

I've loaded ActiveState python (version 2.7) --- installed OK.

I don't need Glade, but I do want to use some Glade XML and run the python application.

To run a Glade application this needs:



from gi.repository import Gtk



gi.repository is not available to import.



Where can I find gi.repository?....all searches to date have come up empty!



Mary

So...it turns out that Glade support for Python 2.7 is pretty difficult.
I ended up rewriting the whole thing using Tkinter and ttk.Treeview.
It would have been good to reuse the Glade XML...less code, better looking, etc. etc.

Ah well.

Mary
 
M

Michael Torrie

So...it turns out that Glade support for Python 2.7 is pretty difficult.
I ended up rewriting the whole thing using Tkinter and ttk.Treeview.
It would have been good to reuse the Glade XML...less code, better looking, etc. etc.

Both Gtk2 and Gtk3 are available for Windows. Glade XML is typically
used on Gtk2 by the GtkBuilder class
(http://www.pygtk.org/pygtk2reference/class-gtkbuilder.html). Gtk3 uses
http://python-gtk-3-tutorial.readthedocs.org/en/latest/builder.html.
The code you had in your OP was for Gtk3.

There are up-to-date packages of Gtk3 bindings for Python on Windows here:

http://sourceforge.net/projects/pygobjectwin32/files/

I didn't see your original post a couple of weeks ago, which is too bad.

I'm not sure Gtk is better-looking on Windows. It's always been the
ugly step-child there compared to Linux.

Tkinter has a Windows native look and feel, so there's no reason to not
use Tkinter if it suits your project:
https://docs.python.org/3/library/tkinter.ttk.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top