]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/tmpl/gtkmessagedialog.sgml
Markup fixes.
[~andy/gtk] / docs / reference / gtk / tmpl / gtkmessagedialog.sgml
1 <!-- ##### SECTION Title ##### -->
2 GtkMessageDialog
3
4 <!-- ##### SECTION Short_Description ##### -->
5
6 convenient message window
7
8 <!-- ##### SECTION Long_Description ##### -->
9 <para>
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.
14 </para>
15
16 <para>
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.
21 <example>
22 <title>A modal dialog.</title>
23 <programlisting>
24  dialog = gtk_message_dialog_new (main_application_window,
25                                   GTK_DIALOG_DESTROY_WITH_PARENT,
26                                   GTK_MESSAGE_ERROR,
27                                   GTK_BUTTONS_CLOSE,
28                                   "Error loading file '%s': %s",
29                                   filename, g_strerror (errno));
30  gtk_dialog_run (GTK_DIALOG (dialog));
31  gtk_widget_destroy (dialog);
32 </programlisting>
33 </example>
34 </para>
35
36 <para>
37 You might do a non-modal #GtkMessageDialog as follows:
38 <example>
39 <title>A non-modal dialog.</title>
40 <programlisting>
41  dialog = gtk_message_dialog_new (main_application_window,
42                                   GTK_DIALOG_DESTROY_WITH_PARENT,
43                                   GTK_MESSAGE_ERROR,
44                                   GTK_BUTTONS_CLOSE,
45                                   "Error loading file '%s': %s",
46                                   filename, g_strerror (errno));
47
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),
51                             GTK_OBJECT (dialog));
52 </programlisting>
53 </example>
54 </para>
55
56 <!-- ##### SECTION See_Also ##### -->
57 <para>
58 #GtkDialog
59 </para>
60
61 <!-- ##### STRUCT GtkMessageDialog ##### -->
62 <para>
63
64 </para>
65
66
67 <!-- ##### ENUM GtkMessageType ##### -->
68 <para>
69 The type of message being displayed in the dialog.
70 </para>
71
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
76
77 <!-- ##### ENUM GtkButtonsType ##### -->
78 <para>
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().
82 </para>
83
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
90
91 <!-- ##### FUNCTION gtk_message_dialog_new ##### -->
92 <para>
93
94 </para>
95
96 @parent: 
97 @flags: 
98 @type: 
99 @buttons: 
100 @message_format: 
101 @Varargs: 
102 @Returns: 
103
104
105 <!-- ##### ARG GtkMessageDialog:message-type ##### -->
106 <para>
107
108 </para>
109
110 <!-- ##### ARG GtkMessageDialog:buttons ##### -->
111 <para>
112
113 </para>
114