[Tutor] Re: another problem
Lee Harr
missive at hotmail.com
Fri Sep 5 23:14:45 EDT 2003
>Ok, I managed the missing glade problem, now there is another problem.
>The following errorline occurs (1 line! sylpheed wraps it)
>
>(gui.py:270): libglade-CRITICAL **: file glade-xml.c: line 1172
>(glade_xml_build_interface): assertion `wid != NULL' failed
>
>The "270" changes, what is this number?
>Any ideas about the error? I confess, i didn't do much about it yet, but
>I have no idea where to start either ... :(
>
Hi;
I started playing around with this one myself, and I found
the problem:
Here is the code I am using:
import gtk
import gtk.glade
class appgui:
def __init__(self):
gladefile="project1.glade"
windowname="window1" # HERE IS THE PROBLEM!
self.wTree=gtk.glade.XML (gladefile,windowname)
dic = { "on_button1_clicked": self.button1_clicked,
"on_serverinfo_destroy": gtk.mainquit }
self.wTree.signal_autoconnect (dic)
def button1_clicked(self,widget):
print "button clicked"
app=appgui()
gtk.mainloop()
This comes from the pygtk tutorial at Linux Journal:
http://www.linuxjournal.com/article.php?sid=6586
####
You need to make sure that windowname matches up
with the name (id) of the window generated by glade.
####
You can either change the name in glade or look through
the .glade file for the tag that looks like:
widget class="GtkWindow" id="window1"
I read back through the article and I do not see it
mentioned, but if they do not match, you get the
error about the missing window.
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
More information about the Tutor
mailing list