Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MessageDialog

[38: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

  • MessageDialog (Handle = null)

    Creates a new MessageDialog by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • 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 Dialog.

    • @r A Dialog object.
  • asAccessible ()

    Wraps this handle as Accessible.

    • @r A Accessible object.
  • asBuildable ()

    Wraps this handle as Buildable.

    • @r A Buildable object.
  • asConstraintTarget ()

    Wraps this handle as ConstraintTarget.

    • @r A ConstraintTarget object.
  • asNative ()

    Wraps this handle as Native.

    • @r A Native object.
  • asRoot ()

    Wraps this handle as Root.

    • @r A Root object.
  • asShortcutManager ()

    Wraps this handle as ShortcutManager.

    • @r A ShortcutManager 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.
  • 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].

  • set_markup (string str)

    Sets the text of the message dialog.

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

class: MessageDialogMeta

[283:14] static extends: object

Generated metadata helpers for MessageDialog class surfaces.

Methods

  • properties ()

    Returns property metadata for MessageDialog.

    • @r A list.