Red Hat 9, Python and Glade - a mixure not working?

Hans Deragon hans at deragon.biz
Sun Jul 6 07:06:59 EDT 2003


"David M. Cook" <davecook at nowhere.net> wrote in message news:<d2HNa.427458$3n5.51831 at news2.central.cox.net>...
> In article <c7427279.0307050724.147536d1 at posting.google.com>, Hans Deragon
> wrote:

[...deleted lines...]

> > gtk.glade.XML('project3.glade')
> 
> Should be
> 
> xml = gtk.glade.XML('project3.glade')

Ok, here I am embarrassed... forgetting to assign xml... ;)

> > xml.autoconnect({
> >   'on_button4_clicked': on_button4_clicked
> > })
> 
> Or you can just use
> 
> xml.signal_autoconnect(locals())
> 
> See glade_demo.py in the /usr/share/doc/pygtk2-1.99.14/examples/glade/.

Thanks for the tips.  But the problem still persist.  Now I run the
following:

------------------
[root at world project3]#
/usr/share/doc/pygtk2-1.99.14/examples/glade/glade-demo.py
project3.glade

(glade-demo.py:3405): GLib-GObject-CRITICAL **: file gobject.c: line
1002 (g_object_get): assertion `G_IS_OBJECT (object)' failed

(glade-demo.py:3405): GLib-GObject-CRITICAL **: file gobject.c: line
1002 (g_object_get): assertion `G_IS_OBJECT (object)' failed
Segmentation fault
------------------

So the problem is not my code.  I must assume that the glade module
for gnome is not adapted for taking in Glade 2 xml?

Then I tried with a Glade 1 xml:

-----------------
[root at world project2]#
/usr/share/doc/pygtk2-1.99.14/examples/glade/glade-demo.p
y project2.glade

(glade-demo.py:3541): libglade-WARNING **: Expected <glade-interface>.
 Got <GTK
-Interface>.

(glade-demo.py:3541): libglade-WARNING **: did not finish in
PARSER_FINISH state
Traceback (most recent call last):
  File "/usr/share/doc/pygtk2-1.99.14/examples/glade/glade-demo.py",
line 12, in
 ?
    xml = gtk.glade.XML(fname)
RuntimeError: could not create GladeXML object
-----------------

Different errors, same results.  Nothing works.  However the
test.glade xml file provided as an example works fine.  I believe that
there is some widget in my glade2 xml file that is simply not
supported by python.  I will investigate further the issue later.

Thanks,
Hans Deragon




More information about the Python-list mailing list