Glade + Python = No GUI

Kveldulv blackmh at gmail.com
Sun Sep 2 15:22:49 EDT 2007


On Sep 2, 9:07 pm, Wildemar Wildenburger
<lasses_w... at klapptsowieso.net> wrote:
> Kveldulv wrote:
> > When interrupted, I get
>
> > File "gui.py", line 11, in <module>
> >     gtk.main()
>
> Ah, I see now. Thats just telling you that *you* interrupted the
> function/method/whateverthatis.
>
> > When GUI coded manually, all works.
>
> Hence: Something in your (generated) code or XML file is corrupt or
> missing. Perhaps some sort of show() call or attribute. I really only
> have marginal experience with pygtk so I'm just stabbing at thin air.
>
> sorry :(
> /W

I sorted it out and you're right. I didn't found out why this thing
didn't work since
it's c/pasted straight from the book I'm learning from but this did
the trick:

class TwoButtonsGUI:
    def __init__(self):
	xml = gtk.glade.XML("buttons.glade")


	self.window = xml.get_widget("window1")
	self.window.show()

etc

Thanks for help!




More information about the Python-list mailing list