Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70520 > unrolled thread

Glade on Windows using Python

Started bymbg1708@planetmail.com
First post2014-04-22 16:08 -0700
Last post2014-05-04 17:27 -0600
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Glade on Windows using Python mbg1708@planetmail.com - 2014-04-22 16:08 -0700
    Re: Glade on Windows using Python mbg1708@planetmail.com - 2014-05-04 12:51 -0700
      Re: Glade on Windows using Python Michael Torrie <torriem@gmail.com> - 2014-05-04 17:27 -0600

#70520 — Glade on Windows using Python

Frommbg1708@planetmail.com
Date2014-04-22 16:08 -0700
SubjectGlade on Windows using Python
Message-ID<62715f8a-8e45-4150-a3c9-ca1183fc6abb@googlegroups.com>
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

[toc] | [next] | [standalone]


#70915

Frommbg1708@planetmail.com
Date2014-05-04 12:51 -0700
Message-ID<e2c08192-8e17-4827-9060-5a0220dc3026@googlegroups.com>
In reply to#70520
On Tuesday, April 22, 2014 7:08:29 PM UTC-4, mbg...@planetmail.com wrote:
> 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

[toc] | [prev] | [next] | [standalone]


#70916

FromMichael Torrie <torriem@gmail.com>
Date2014-05-04 17:27 -0600
Message-ID<mailman.9676.1399246041.18130.python-list@python.org>
In reply to#70915
On 05/04/2014 01:51 PM, mbg1708@planetmail.com wrote:
> 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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web