do not use a second loop to print dialogs (do not use run)

This commit is contained in:
Yann Leboulanger 2005-03-03 22:15:45 +00:00
parent b592f60c45
commit 6ed0c6d097
1 changed files with 15 additions and 9 deletions

View File

@ -489,33 +489,39 @@ class confirm_dialog:
class warning_dialog: class warning_dialog:
"""Class for warning dialog""" """Class for warning dialog"""
def on_response(self, dialog, response_id):
dialog.destroy()
def __init__(self, label): def __init__(self, label):
dialog = gtk.MessageDialog(None,\ dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, label) gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, label)
dialog.connect('response', self.on_response)
dialog.run() dialog.show()
dialog.destroy()
class information_dialog: class information_dialog:
"""Class for information dialog""" """Class for information dialog"""
def on_response(self, dialog, response_id):
dialog.destroy()
def __init__(self, label): def __init__(self, label):
dialog = gtk.MessageDialog(None,\ dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, label) gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, label)
dialog.connect('response', self.on_response)
dialog.run() dialog.show()
dialog.destroy()
class error_dialog: class error_dialog:
"""Class for error dialog""" """Class for error dialog"""
def on_response(self, dialog, response_id):
dialog.destroy()
def __init__(self, label): def __init__(self, label):
dialog = gtk.MessageDialog(None,\ dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\ gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, label) gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, label)
dialog.connect('response', self.on_response)
dialog.run() dialog.show()
dialog.destroy()
class subscription_request_window: class subscription_request_window:
"""Class for authorization window : """Class for authorization window :