MessageDialog.with_markup


Description:

[ CCode ( has_construct_function = false , type = "GtkWidget*" ) ]
[ PrintfFormat ]
[ Version ( since = "2.4" ) ]
public MessageDialog.with_markup (Window? parent, DialogFlags flags, MessageType type, ButtonsType buttons, string? message_format, ...)

Creates a new message dialog, which is a simple dialog with some text that is marked up with the Pango text markup language.

When the user clicks a button a “response” signal is emitted with response IDs from ResponseType. See Dialog for more details.

Special XML characters in the printf arguments passed to this function will automatically be escaped as necessary. (See printf_escaped for how this is implemented.) Usually this is what you want, but if you have an existing Pango markup string that you want to use literally as the label, then you need to use set_markup instead, since you can’t pass the markup string either as the format (it might contain “%” characters) or as a string argument.

 GtkWidget *dialog;
GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
dialog = gtk_message_dialog_new (parent_window,
flags,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
NULL);
gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG (dialog),
markup);

Parameters:

parent

transient parent, or null for none

flags

flags

type

type of message

buttons

set of buttons to use

message_format

printf-style format string, or null

...

arguments for message_format

Returns:

a new MessageDialog