def __init__(self, title='Login', buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)): HIGDialog.__init__(self, title, buttons=buttons) self.username_label = HIGEntryLabel("Username:"******"Password:") self.password_entry = HIGPasswordEntry() self.username_password_table = HIGTable(2, 2) self.username_password_table.attach_label(self.username_label, 0, 1, 0, 1) self.username_password_table.attach_entry(self.username_entry, 1, 2, 0, 1) self.username_password_table.attach_label(self.password_label, 0, 1, 1, 2) self.username_password_table.attach_entry(self.password_entry, 1, 2, 1, 2) self.vbox.pack_start(self.username_password_table, False, False) self.set_default_response(gtk.RESPONSE_ACCEPT)
try: self.format_secondary_text(secondary_text) except: pass if __name__ == '__main__': from higlabels import HIGEntryLabel, HIGDialogLabel # HIGDialog d = HIGDialog(title='HIGDialog', buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) dialog_label = HIGDialogLabel('A HIGDialogLabel on a HIGDialog') dialog_label.show() d.vbox.pack_start(dialog_label) entry_label = HIGEntryLabel('A HIGEntryLabel on a HIGDialog') entry_label.show() d.vbox.pack_start(entry_label) d.run() d.destroy() # HIGAlertDialog d = HIGAlertDialog(message_format="You Have and Appointment in 15 minutes", secondary_text="You shouldn't be late this time. " "Oh, and there's a huge traffic jam on your way!") d.run() d.destroy()