PyGTK Tutorial
PyGTK Useful Resources
Selected Reading
- PyGTK - Drag and Drop
- PyGTK - Timeout
- PyGTK - Ruler Class
- PyGTK - Clipboard Class
- PyGTK - Calendar Class
- PyGTK - SpinButton Class
- PyGTK - DrawingArea Class
- PyGTK - Image Class
- PyGTK - Arrow Class
- PyGTK - Scrolledwindow Class
- PyGTK - Viewport Class
- PyGTK - ProgressBar Class
- PyGTK - Statusbar Class
- PyGTK - Paned Class
- PyGTK - TreeView Class
- PyGTK - AspectFrame Class
- PyGTK - Frame Class
- PyGTK - Notebook Class
- PyGTK - File Chooser Dialog
- PyGTK - Color Selection Dialog
- PyGTK - Font Selection Dialog
- PyGTK - AboutDialog Class
- PyGTK - MessageDialog Class
- PyGTK - Dialog Class
- PyGTK - Scrollbar Class
- PyGTK - Scale Class
- PyGTK - Range Class
- PyGTK - Adjustment Class
- PyGTK - Toolbar Class
- PyGTK - MenuBar, Menu & MenuItem
- PyGTK - RadioButton Class
- PyGTK - CheckButton Class
- PyGTK - ToggleButton Class
- PyGTK - ComboBox Class
- PyGTK - Layout Class
- PyGTK - EventBox Class
- PyGTK - Alignment Class
- PyGTK - ButtonBox Class
- PyGTK - Box Class
- PyGTK - Containers
- PyGTK - Event Handling
- PyGTK - Signal Handling
- PyGTK - Entry Class
- PyGTK - Label CLass
- PyGTK - Button Class
- PyGTK - Window Class
- PyGTK - Important Classes
- PyGTK - Hello World
- PyGTK - Environment
- PyGTK - Introduction
- PyGTK - Home
PyGTK Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
PyGTK - MessageDialog Class
PyGTK - MessageDialog Class
A Messagedialog widget is a Dialog window configured to display an image representing the type of message, i.e., error, question, or some informational text. A MessageDialog object is declared by using the following constructor −
gtk.MessageDialog(parent = None, flags = 0, type = gtk.MESSAGE_INFO, buttons = gtk.BUTTONS_NONE, message_format = None)
The following predefined message types are used to configure message dialog −
gtk.MESSAGE_INFO | This is an informational message |
gtk.MESSAGE_WARNING | This is a nonfatal warning message |
gtk.MESSAGE_QUESTION | This question requires a choice |
gtk.MESSAGE_ERROR | This is a fatal error message |
A set of predefined button sets are also available for use.
gtk.BUTTONS_NONE | No buttons at all |
gtk.BUTTONS_OK | This is an OK button |
gtk.BUTTONS_CLOSE | This is a Close button |
gtk.BUTTONS_CANCEL | This is a Cancel button |
gtk.BUTTONS_YES_NO | These are the Yes and No buttons |
gtk.BUTTONS_OK_CANCEL | These are OK and Cancel buttons |
When the MessageBox menu item is activated, the following callback function is called and a message box pops up as an output.
def on_msgdlg(self, widget): md = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, "Error message") md.run()
The above function will generate the following output −
Advertisements