summaryrefslogtreecommitdiff
path: root/docs/reference/gtk/tmpl/gtkmessagedialog.sgml
blob: f2122cbd095b907ff522c06e81c98529f1d8a261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!-- ##### SECTION Title ##### -->
GtkMessageDialog

<!-- ##### SECTION Short_Description ##### -->
A convenient message window

<!-- ##### SECTION Long_Description ##### -->
<para>
#GtkMessageDialog presents a dialog with an image representing the type of 
message (Error, Question, etc.) alongside some message text. It's simply a 
convenience widget; you could construct the equivalent of #GtkMessageDialog 
from #GtkDialog without too much effort, but #GtkMessageDialog saves typing.
</para>

<para>
The easiest way to do a modal message dialog is to use gtk_dialog_run(), though
you can also pass in the %GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically
makes the dialog modal and waits for the user to respond to it. gtk_dialog_run()
returns when any dialog button is clicked.
<example>
<title>A modal dialog.</title>
<programlisting>
 dialog = gtk_message_dialog_new (main_application_window,
                                  GTK_DIALOG_DESTROY_WITH_PARENT,
                                  GTK_MESSAGE_ERROR,
                                  GTK_BUTTONS_CLOSE,
                                  "Error loading file '&percnt;s': &percnt;s",
                                  filename, g_strerror (errno));
 gtk_dialog_run (GTK_DIALOG (dialog));
 gtk_widget_destroy (dialog);
</programlisting>
</example>
</para>

<para>
You might do a non-modal #GtkMessageDialog as follows:
<example>
<title>A non-modal dialog.</title>
<programlisting>
 dialog = gtk_message_dialog_new (main_application_window,
                                  GTK_DIALOG_DESTROY_WITH_PARENT,
                                  GTK_MESSAGE_ERROR,
                                  GTK_BUTTONS_CLOSE,
                                  "Error loading file '&percnt;s': &percnt;s",
                                  filename, g_strerror (errno));

 /* Destroy the dialog when the user responds to it (e.g. clicks a button) */
 g_signal_connect_swapped (dialog, "response",
                           G_CALLBACK (gtk_widget_destroy),
                           dialog);
</programlisting>
</example>
</para>

<!-- ##### SECTION See_Also ##### -->
<para>
#GtkDialog
</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### STRUCT GtkMessageDialog ##### -->
<para>

</para>


<!-- ##### ARG GtkMessageDialog:buttons ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:image ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:message-type ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:secondary-text ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:secondary-use-markup ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:text ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:use-markup ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:message-border ##### -->
<para>

</para>

<!-- ##### ARG GtkMessageDialog:use-separator ##### -->
<para>

</para>

<!-- ##### ENUM GtkMessageType ##### -->
<para>
The type of message being displayed in the dialog.
</para>

@GTK_MESSAGE_INFO: Informational message
@GTK_MESSAGE_WARNING: Nonfatal warning message
@GTK_MESSAGE_QUESTION: Question requiring a choice
@GTK_MESSAGE_ERROR: Fatal error message
@GTK_MESSAGE_OTHER: None of the above, doesn't get an icon

<!-- ##### ENUM GtkButtonsType ##### -->
<para>
Prebuilt sets of buttons for the dialog. If 
none of these choices are appropriate, simply use %GTK_BUTTONS_NONE
then call gtk_dialog_add_buttons().
</para>

@GTK_BUTTONS_NONE: no buttons at all
@GTK_BUTTONS_OK: an OK button
@GTK_BUTTONS_CLOSE: a Close button
@GTK_BUTTONS_CANCEL: a Cancel button
@GTK_BUTTONS_YES_NO: Yes and No buttons
@GTK_BUTTONS_OK_CANCEL: OK and Cancel buttons

<!-- ##### FUNCTION gtk_message_dialog_new ##### -->
<para>

</para>

@parent: 
@flags: 
@type: 
@buttons: 
@message_format: 
@Varargs: 
@Returns: 


<!-- ##### FUNCTION gtk_message_dialog_new_with_markup ##### -->
<para>

</para>

@parent: 
@flags: 
@type: 
@buttons: 
@message_format: 
@Varargs: 
@Returns: 


<!-- ##### FUNCTION gtk_message_dialog_set_markup ##### -->
<para>

</para>

@message_dialog: 
@str: 


<!-- ##### FUNCTION gtk_message_dialog_set_image ##### -->
<para>

</para>

@dialog: 
@image: 


<!-- ##### FUNCTION gtk_message_dialog_get_image ##### -->
<para>

</para>

@dialog: 
@Returns: 


<!-- ##### FUNCTION gtk_message_dialog_format_secondary_text ##### -->
<para>

</para>

@message_dialog: 
@message_format: 
@Varargs: 


<!-- ##### FUNCTION gtk_message_dialog_format_secondary_markup ##### -->
<para>

</para>

@message_dialog: 
@message_format: 
@Varargs: