2 * This file is part of duit.
4 * duit is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * duit is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkMessageDialog.html
27 * outFile = MessageDialog
28 * strct = GtkMessageDialog
31 * clss = MessageDialog
39 * - gtk_message_dialog_
44 * - gtk_message_dialog_new
45 * - gtk_message_dialog_new_with_markup
50 * - GtkWindow* -> Window
54 module gtk
.MessageDialog
;
56 private import gtk
.gtktypes
;
58 private import lib
.gtk
;
60 private import glib
.Str
;
61 private import gtk
.Window
;
65 * GtkMessageDialog presents a dialog with an image representing the type of
66 * message (Error, Question, etc.) alongside some message text. It's simply a
67 * convenience widget; you could construct the equivalent of GtkMessageDialog
68 * from GtkDialog without too much effort, but GtkMessageDialog saves typing.
69 * The easiest way to do a modal message dialog is to use gtk_dialog_run(), though
70 * you can also pass in the GTK_DIALOG_MODAL flag, gtk_dialog_run() automatically
71 * makes the dialog modal and waits for the user to respond to it. gtk_dialog_run()
72 * returns when any dialog button is clicked.
73 * Example2.A modal dialog.
74 * dialog = gtk_message_dialog_new (main_application_window,
75 * GTK_DIALOG_DESTROY_WITH_PARENT,
78 * "Error loading file '%s': %s",
79 * filename, g_strerror (errno));
80 * gtk_dialog_run (GTK_DIALOG (dialog));
81 * gtk_widget_destroy (dialog);
82 * You might do a non-modal GtkMessageDialog as follows:
83 * Example3.A non-modal dialog.
84 * dialog = gtk_message_dialog_new (main_application_window,
85 * GTK_DIALOG_DESTROY_WITH_PARENT,
88 * "Error loading file '%s': %s",
89 * filename, g_strerror (errno));
90 * /+* Destroy the dialog when the user responds to it (e.g. clicks a button) +/
91 * g_signal_connect_swapped (dialog, "response",
92 * G_CALLBACK (gtk_widget_destroy),
95 private import gtk
.Dialog
;
96 public class MessageDialog
: Dialog
99 /** the main Gtk struct */
100 protected GtkMessageDialog
* gtkMessageDialog
;
103 public GtkMessageDialog
* getMessageDialogStruct()
105 return gtkMessageDialog
;
109 /** the main Gtk struct as a void* */
110 protected void* getStruct()
112 return cast(void*)gtkMessageDialog
;
116 * Sets our main struct and passes it to the parent class
118 public this (GtkMessageDialog
* gtkMessageDialog
)
120 super(cast(GtkDialog
*)gtkMessageDialog
);
121 this.gtkMessageDialog
= gtkMessageDialog
;
125 * Creates a new message dialog, which is a simple dialog with an icon
126 * indicating the dialog type (error, warning, etc.) and some text the
127 * user may want to see. When the user clicks a button a "response"
128 * signal is emitted with response IDs from GtkResponseType. See
129 * GtkDialog for more details.
131 * transient parent, or NULL for none
137 * set of buttons to use
139 * printf()-style format string, or NULL
141 * the message - should be null, any formatting should be done prior to call this constructor
142 * arguments for message_format
144 * a new GtkMessageDialog
146 public this (Window parent
, GtkDialogFlags flags
, GtkMessageType type
, GtkButtonsType buttons
, char[] messageFormat
, char[] message
=null )
148 this(parent
, flags
, type
, buttons
, false, messageFormat
, message
);
152 * Creates a new message dialog, which is a simple dialog with an icon
153 * indicating the dialog type (error, warning, etc.) and some text which
154 * is marked up with the Pango text markup language.
155 * When the user clicks a button a "response" signal is emitted with
156 * response IDs from GtkResponseType. See GtkDialog for more details.
158 * If Markup is true special XML characters in the printf() arguments passed to this
159 * function will automatically be escaped as necessary.
160 * (See g_markup_printf_escaped() for how this is implemented.)
161 * Usually this is what you want, but if you have an existing
162 * Pango markup string that you want to use literally as the
163 * label, then you need to use gtk_message_dialog_set_markup()
164 * instead, since you can't pass the markup string either
165 * as the format (it might contain '%' characters) or as a string
168 * dialog = gtk_message_dialog_new (main_application_window,
169 * GTK_DIALOG_DESTROY_WITH_PARENT,
173 * gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
176 * transient parent, or NULL for none
182 * set of buttons to use
184 * printf()-style format string, or NULL
186 * the message - should be null, any formatting should be done prior to call this constructor
188 * arguments for message_format
190 * a new GtkMessageDialog
193 public this (Window parent
, GtkDialogFlags flags
, GtkMessageType type
, GtkButtonsType buttons
, bit markup
, char[] messageFormat
, char[] message
=null )
197 // GtkWidget* gtk_message_dialog_new_with_markup (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
199 cast(GtkMessageDialog
*)gtk_message_dialog_new_with_markup(
200 parent
is null ?
null : parent
.getWindowStruct(),
204 Str
.toStringz(messageFormat
),
205 Str
.toStringz(message
), // this should be null
212 // GtkWidget* gtk_message_dialog_new (GtkWindow *parent, GtkDialogFlags flags, GtkMessageType type, GtkButtonsType buttons, const gchar *message_format, ...);
214 cast(GtkMessageDialog
*)gtk_message_dialog_new(
215 parent
is null ?
null : parent
.getWindowStruct(),
219 Str
.toStringz(messageFormat
),
220 Str
.toStringz(message
), // this should be null
237 * Sets the text of the message dialog to be str, which is marked
238 * up with the Pango text markup
243 * markup string (see Pango markup format)
246 public void setMarkup(char[] str)
248 // void gtk_message_dialog_set_markup (GtkMessageDialog *message_dialog, const gchar *str);
249 gtk_message_dialog_set_markup(gtkMessageDialog
, Str
.toStringz(str));
253 * Sets the dialog's image to image.
260 public void setImage(GtkWidget
* image
)
262 // void gtk_message_dialog_set_image (GtkMessageDialog *dialog, GtkWidget *image);
263 gtk_message_dialog_set_image(gtkMessageDialog
, image
);
267 * Sets the secondary text of the message dialog to be message_format
268 * (with printf()-style).
269 * Note that setting a secondary text makes the primary text become
270 * bold, unless you have provided explicit markup.
274 * printf()-style format string, or NULL
276 * arguments for message_format
279 public void formatSecondaryText(char[] messageFormat
, ... )
281 // void gtk_message_dialog_format_secondary_text (GtkMessageDialog *message_dialog, const gchar *message_format, ...);
282 gtk_message_dialog_format_secondary_text(gtkMessageDialog
, Str
.toStringz(messageFormat
));
286 * Sets the secondary text of the message dialog to be message_format (with
287 * printf()-style), which is marked up with the
288 * Pango text markup language.
289 * Note that setting a secondary text makes the primary text become
290 * bold, unless you have provided explicit markup.
291 * Due to an oversight, this function does not escape special XML characters
292 * like gtk_message_dialog_new_with_markup() does. Thus, if the arguments
293 * may contain special XML characters, you should use g_markup_printf_escaped()
296 * msg = g_markup_printf_escaped (message_format, ...);
297 * gtk_message_dialog_format_secondary_markup (message_dialog, "%s", msg);
302 * printf()-style markup string (see
303 * Pango markup format), or NULL
305 * arguments for message_format
308 * The "buttons" property
309 * "buttons" GtkButtonsType : Write / Construct Only
310 * The buttons shown in the message dialog.
311 * Default value: GTK_BUTTONS_NONE
313 public void formatSecondaryMarkup(char[] messageFormat
, ... )
315 // void gtk_message_dialog_format_secondary_markup (GtkMessageDialog *message_dialog, const gchar *message_format, ...);
316 gtk_message_dialog_format_secondary_markup(gtkMessageDialog
, Str
.toStringz(messageFormat
));