ok button is focused by default

This commit is contained in:
Dimitur Kirov 2005-07-30 00:27:58 +00:00
parent 689af77a53
commit c31e8e9d41
1 changed files with 4 additions and 3 deletions

View File

@ -484,11 +484,12 @@ class ConfirmationDialogCheck(ConfirmationDialog):
'''HIG compliant confirmation dialog with checkbutton.'''
def __init__(self, pritext, sectext='', checktext = ''):
HigDialog.__init__(self, None, pritext, sectext,
gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL],
[ gtk.STOCK_OK, gtk.RESPONSE_OK ] ])
gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL] ])
# add ok button manually, because we need to focus on it
ok_button = self.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
self.checkbutton = gtk.CheckButton(checktext)
self.vbox.pack_start(self.checkbutton, expand=False, fill=True)
ok_button.grab_focus()
# override this method not to destroy the dialog
def get_response(self):
self.show_all()