PDA

View Full Version : Pygtk change the default button when a Message Dialog is called



Patagon
May 14th, 2010, 08:49 PM
Hello,

I can change the default button when a Message Dialog is called?:



dialog = gtk.MessageDialog(window, gtk.DIALOG_MODAL,
gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO,
"Exit? ")

The default button is "NO", I need to change to "Yes".


Thanks

steeleyuk
May 14th, 2010, 09:26 PM
You just need to add...


dialog.set_default_response(gtk.RESPONSE_YES)

...before dialog.run() is called.

Patagon
May 15th, 2010, 01:45 AM
You just need to add...


dialog.set_default_response(gtk.RESPONSE_YES)

...before dialog.run() is called.


Thanks!

It worked