1

In gtk/python, what is the equivalent of MessageBox?

1
  • It should be noted Pygtk is getting replaced with gi.repository Gtk bindings, these answers may not work well for new projects.
    – NoBugs
    Nov 2, 2015 at 5:09

2 Answers 2

3

That would be gtk.MessageDialog.

Example:

parent = None
md = gtk.MessageDialog(parent, 
    gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_INFO, 
    gtk.BUTTONS_CLOSE, "Download completed")
md.run()
0
3

You can follow this tutorial about message dialogs with PyGTK :

http://zetcode.com/tutorials/pygtktutorial/dialogs

In addition, you can read the documentation about the MessageDialog class.

1
  • not surprsing for such an old answer but both links are now dead...
    – zpangwin
    Apr 8, 2022 at 0:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.