I have a problem with sowing a dialog using glade and pygtk, here is my
code:
class Sample:
def __init__ (self):
self.builder = gtk.Builder()
self.builder.add_from_file("../data/sample.glade")
self.builder.connect_signals(self)
self.window = self.builder.get_object("mywindow")
self.window.set_modal(True)
self.window.show_all()
def addDialog(self, sender):
dialog = self.builder.get_object("dialog1")
label = self.builder.get_object("label2")
print label.get_text()
print dialog.get_title()
result = dialog.run()
if result == 1 :
print "ok!"
else :
print "no, thanks :D"
dialog.destroy()
I have connected addDialog to the clicked event of a button on "mywindow".
The first time I click it, I can see "dialog1" which has "label2"
inside. the next time I click that button, "dialog1" is opened but with
no widgets inside!
but in trminal the "label2" text and "dialog1" title is printed
correctly, means that they are constructed but not visible.
I also connected "dialog1" delete-event to gtk_widget_hide in the glade
file, but no changes happend.
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/