Пример #1
0
 def show_question(self, text, secondary_text=""):
     dialog = Gtk.MessageDialog(parent=self,
                                flags=Gtk.DialogFlags.MODAL,
                                message_type=Gtk.MessageType.WARNING,
                                buttons=Gtk.ButtonsType.OK_CANCEL,
                                message_format=text)
     if secondary_text:
         dialog.format_secondary_text(secondary_text)
     response = dialog.run()
     dialog.destroy()
     return response == Gtk.ResponseType.OK
Пример #2
0
 def show_error(self, text, secondary_text=""):
     dialog = Gtk.MessageDialog(parent=self,
                                modal=True,
                                destroy_with_parent=True,
                                message_type=Gtk.MessageType.ERROR,
                                buttons=Gtk.ButtonsType.OK,
                                text=text)
     if secondary_text:
         dialog.format_secondary_text(secondary_text)
     dialog.run()
     dialog.destroy()