Try this:
gladeobj = gtk.glade.XML(gladeFile, 'dialog1')
dialog = gladeobj.get_widget('dialog1')
okButton = gladeobj.get_widget('okButton')
cancelButton = gladeobj.get_widget('cancelButton')
You are creating a new instance every time you call gtk.glade.XML, one
for the dialog, one for the okButton and one for the cancelButton,
On Sun, 2009-08-30 at 19:14 +0200, Fabrice DELENTE wrote:
> 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!
>
--
<--Linux... Because I'm Free-->
Marco Antonio Islas Cruz
"Markuz"
Linux User #280229
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
http://www.islascruz.org
http://wwww.christine-project.org
http://www.linuxpozarica.com
signature.asc
Description: This is a digitally signed message part
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
