1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
6 convenient message window
8 <!-- ##### SECTION Long_Description ##### -->
10 #GtkMessageDialog presents a dialog with an image representing the type of
11 message (Error, Question, etc.) alongside some message text. It's simply a
12 convenience widget; you could construct the equivalent of #GtkMessageDialog
13 from #GtkDialog without too much effort, but #GtkMessageDialog saves typing.
17 The easiest way to do a modal message dialog is to use gtk_dialog_run(), though
18 you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically
19 makes the dialog modal and waits for the user to respond to it. gtk_dialog_run()
20 returns when any dialog button is clicked.
22 <title>A modal dialog.</title>
24 dialog = gtk_message_dialog_new (main_application_window,
25 GTK_DIALOG_DESTROY_WITH_PARENT,
28 "Error loading file '%s': %s",
29 filename, g_strerror (errno));
30 gtk_dialog_run (GTK_DIALOG (dialog));
31 gtk_widget_destroy (dialog);
37 You might do a non-modal #GtkMessageDialog as follows:
39 <title>A non-modal dialog.</title>
41 dialog = gtk_message_dialog_new (main_application_window,
42 GTK_DIALOG_DESTROY_WITH_PARENT,
45 "Error loading file '%s': %s",
46 filename, g_strerror (errno));
48 /* Destroy the dialog when the user responds to it (e.g. clicks a button) */
49 gtk_signal_connect_object (GTK_OBJECT (dialog), "response",
50 GTK_SIGNAL_FUNC (gtk_widget_destroy),
56 <!-- ##### SECTION See_Also ##### -->
61 <!-- ##### STRUCT GtkMessageDialog ##### -->
67 <!-- ##### ENUM GtkMessageType ##### -->
69 The type of message being displayed in the dialog.
72 @GTK_MESSAGE_INFO: Informational message
73 @GTK_MESSAGE_WARNING: Nonfatal warning message
74 @GTK_MESSAGE_QUESTION: Question requiring a choice
75 @GTK_MESSAGE_ERROR: Fatal error message
77 <!-- ##### ENUM GtkButtonsType ##### -->
79 Prebuilt sets of buttons for the dialog. If
80 none of these choices are appropriate, simply use %GTK_BUTTONS_NONE
81 then call gtk_dialog_add_buttons().
84 @GTK_BUTTONS_NONE: no buttons at all
85 @GTK_BUTTONS_OK: an OK button
86 @GTK_BUTTONS_CLOSE: a Close button
87 @GTK_BUTTONS_CANCEL: a Cancel button
88 @GTK_BUTTONS_YES_NO: Yes and No buttons
89 @GTK_BUTTONS_OK_CANCEL: OK and Cancel buttons
91 <!-- ##### FUNCTION gtk_message_dialog_new ##### -->
105 <!-- ##### ARG GtkMessageDialog:message-type ##### -->
110 <!-- ##### ARG GtkMessageDialog:buttons ##### -->