Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GtkMessageDialogCtors

[349:14] static extends: object

Alternate constructors for GtkMessageDialog. Usage: GtkMessageDialogCtors.<name>(...). The primary constructor lives directly on GtkMessageDialog.

Methods

  • newWithMarkup (object parent, string flags, string type, string buttons, string message_format, list varargs)

    Creates a new message dialog. This is a simple dialog with some text that is marked up with Pango markup. When the user clicks a button a “response” signal is emitted with response IDs from [enum@Gtk.ResponseType]. See [class@Gtk.Dialog] for more details. Special XML characters in the printf() arguments passed to this function will automatically be escaped as necessary. (See g_markup_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 [method@Gtk.MessageDialog.set_markup] instead, since you can’t pass the markup string either as the format (it might contain “%” characters) or as a string argument. c 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);

    • @p parent is transient parent.
    • @p flags is flags.
    • @p type is type of message.
    • @p buttons is set of buttons to use.
    • @p message_format is printf()-style format string.
    • @p ... is arguments for @message_format.
    • @r A new GtkMessageDialog.

class: GtkMessageDialog

[39:7] extends: object

GtkMessageDialog presents a dialog with some message text. An example GtkMessageDialog It’s simply a convenience widget; you could construct the equivalent of GtkMessageDialog from GtkDialog without too much effort, but GtkMessageDialog saves typing. The easiest way to do a modal message dialog is to use the %GTK_DIALOG_MODAL flag, which will call [method@Gtk.Window.set_modal] internally. The dialog will prevent interaction with the parent window until it's hidden or destroyed. You can use the [signal@Gtk.Dialog::response] signal to know when the user dismissed the dialog. An example for using a modal dialog: c GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL; dialog = gtk_message_dialog_new (parent_window, flags, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error reading “%s”: %s", filename, g_strerror (errno)); // Destroy the dialog when the user responds to it // (e.g. clicks a button) g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL); You might do a non-modal GtkMessageDialog simply by omitting the %GTK_DIALOG_MODAL flag: c GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT; dialog = gtk_message_dialog_new (parent_window, flags, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "Error reading “%s”: %s", filename, g_strerror (errno)); // Destroy the dialog when the user responds to it // (e.g. clicks a button) g_signal_connect (dialog, "response", G_CALLBACK (gtk_window_destroy), NULL); # GtkMessageDialog as GtkBuildable The GtkMessageDialog implementation of the GtkBuildable interface exposes the message area as an internal child with the name “message_area”.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GtkMessageDialog (parent = null, flags = null, type = null, buttons = null, message_format = null, ___ = null)

    Creates a new message dialog. This is a simple dialog with some text the user may want to see. When the user clicks a button a “response” signal is emitted with response IDs from [enum@Gtk.ResponseType]. See [class@Gtk.Dialog] for more details.

    • @p parent is transient parent.
    • @p flags is flags.
    • @p type is type of message.
    • @p buttons is set of buttons to use.
    • @p message_format is printf()-style format string.
    • @p ___ is arguments for @message_format.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asDialog ()

    Wraps this handle as GtkDialog.

    • @r A GtkDialog object.
  • asAccessible ()

    Wraps this handle as GtkAccessible.

    • @r A GtkAccessible object.
  • asBuildable ()

    Wraps this handle as GtkBuildable.

    • @r A GtkBuildable object.
  • asConstraintTarget ()

    Wraps this handle as GtkConstraintTarget.

    • @r A GtkConstraintTarget object.
  • asNative ()

    Wraps this handle as GtkNative.

    • @r A GtkNative object.
  • asRoot ()

    Wraps this handle as GtkRoot.

    • @r A GtkRoot object.
  • asShortcutManager ()

    Wraps this handle as GtkShortcutManager.

    • @r A GtkShortcutManager object.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setMessagetype (string Value)

    The type of the message.

    • @p Value is the new property value.
    • @r None.
  • setSecondarytext (string Value)

    The secondary text of the message dialog.

    • @p Value is the new property value.
    • @r None.
  • setSecondaryusemarkup (bool Value)

    %TRUE if the secondary text of the dialog includes Pango markup. See [func@Pango.parse_markup].

    • @p Value is the new property value.
    • @r None.
  • setText (string Value)

    The primary text of the message dialog. If the dialog has a secondary text, this will appear as the title.

    • @p Value is the new property value.
    • @r None.
  • setUsemarkup (bool Value)

    %TRUE if the primary text of the dialog includes Pango markup. See [func@Pango.parse_markup].

    • @p Value is the new property value.
    • @r None.
  • format_secondary_markup (string message_format, list varargs)

    Sets the secondary text of the message dialog. The @message_format is assumed to contain Pango markup. Due to an oversight, this function does not escape special XML characters like [ctor@Gtk.MessageDialog.new_with_markup] does. Thus, if the arguments may contain special XML characters, you should use g_markup_printf_escaped() to escape it. c char *msg; msg = g_markup_printf_escaped (message_format, ...); gtk_message_dialog_format_secondary_markup (message_dialog, "%s", msg); g_free (msg);

    • @p message_format is printf()-style string with Pango markup.
    • @p ... is arguments for @message_format.
    • @r None.
  • format_secondary_text (string message_format, list varargs)

    Sets the secondary text of the message dialog.

    • @p message_format is printf()-style format string.
    • @p ... is arguments for @message_format.
    • @r None.
  • get_message_area ()

    Returns the message area of the dialog. This is the box where the dialog’s primary and secondary labels are packed. You can add your own extra content to that box and it will appear below those labels. See [method@Gtk.Dialog.get_content_area] for the corresponding function in the parent [class@Gtk.Dialog].

    • @r A GtkBox corresponding to the “message area” in the @message_dialog.
  • set_markup (string str)

    Sets the text of the message dialog.

    • @p str is string with Pango markup.
    • @r None.

class: GtkMessageDialogMeta

[390:14] static extends: object

Generated metadata helpers for MessageDialog class surfaces.

Methods

  • properties ()

    Returns property metadata for MessageDialog.

    • @r A list.