[pygtk] gtk.Dialog question
Nico
nbd at free.fr
Wed Apr 15 22:54:32 WST 2009
Hi , I have some troubles on using gtk.MessageDialog.
When I close the window all the app is frozen.
I notice that with messageDialog issued from click on gui I have no
problems on close.
But when this messageDialog display is not due to gui interaction, for
example indicating that a file loading is failed, the app is frosen when
I leave the messageDialog. In that case I don't know which is the
'parent ' of the messageDialog. I try with None and the main window
object. Behavior is the same .
The app seems to freeze just after the destroy action .
Thanks in advance for help
Nico
PS : I joined my classmethod used to display the error message
def ErrorMessage(cls,parent = None ,message = None ):
""" Display an Error message """
def hide_window(window, event):
window.hide()
print "hide window"
return True
dialog = gtk.MessageDialog(parent = parent,
flags = gtk.DIALOG_MODAL |
gtk.DIALOG_DESTROY_WITH_PARENT,
type = gtk.MESSAGE_ERROR,
buttons = gtk.BUTTONS_CLOSE,
message_format = message)
dialog.connect('delete-event', hide_window)
dialog.show_all()
result = dialog.run()
if result == gtk.RESPONSE_CLOSE:
dialog.destroy()
ErrorMessage = classmethod(ErrorMessage)
More information about the pygtk
mailing list