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.''' '''HIG compliant confirmation dialog with checkbutton.'''
def __init__(self, pritext, sectext='', checktext = ''): def __init__(self, pritext, sectext='', checktext = ''):
HigDialog.__init__(self, None, pritext, sectext, HigDialog.__init__(self, None, pritext, sectext,
gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL], gtk.STOCK_DIALOG_WARNING, [ [gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL] ])
[ gtk.STOCK_OK, gtk.RESPONSE_OK ] ]) # 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.checkbutton = gtk.CheckButton(checktext)
self.vbox.pack_start(self.checkbutton, expand=False, fill=True) self.vbox.pack_start(self.checkbutton, expand=False, fill=True)
ok_button.grab_focus()
# override this method not to destroy the dialog # override this method not to destroy the dialog
def get_response(self): def get_response(self):
self.show_all() self.show_all()