[pygtk] Glade interface and Dialog: buttons don't work
Fabrice DELENTE
fdelente at mail.cpod.fr
Mon Aug 31 01:14:50 WST 2009
Hello.
I designed an interface with Glade, and I want to use it with PyGtk.
In this interface, there is a Window and a Dialog. The Dialog is popped up
when I click a button in the Window.
I have a reference to the Dialog:
dialog = gtk.glade.XML(gladeFile, "dialog1").get_widget("dialog1")
and references to the two button that are in the action area:
okButton = gtk.glade.XML(gladeFile, "dialog1").get_widget("okButton")
cancelButton = gtk.glade.XML(gladeFile, "dialog1").get_widget("cancelButton")
These buttons are connected to handlers in Glade: okButton's activate and
clicked signals are connected to handleOkButton, and cancelButton's activate
and clicked signals to handleCancelButton.
I have defined these handlesr:
def handleOkButton(widget):
print "ok button pressed"
def handleCancelButton(widget):
print "cancel button pressed"
but nothing happens when I pop up my Dialog with dialog.show_all() and I
click either Ok or Cancel... I tried with dialog.run(), and it didn't worked
either.
Any hint? Thanks!
--
Fabrice DELENTE
More information about the pygtk
mailing list