Creates a new adw.message_dialog.MessageDialog.
Adds a response with id and label to self.
This function shows self to the user.
Finishes the adw.message_dialog.MessageDialog.choose call and returns the response ID.
Connect to Response signal.
Gets the body text of self.
Gets whether the body text of self includes Pango markup.
Gets the ID of the close response of self.
Gets the ID of the default response of self.
Gets the child widget of self.
Gets the heading of self.
Gets whether the heading of self includes Pango markup.
Gets the appearance of response.
Gets whether response is enabled.
Gets the label of response.
Gets whether self has a response with the ID response.
Removes a response from self.
Emits the signalMessageDialog::response signal with the given response ID.
Sets the body text of self.
Sets whether the body text of self includes Pango markup.
Sets the ID of the close response of self.
Sets the ID of the default response of self.
Sets the child widget of self.
Sets the heading of self.
Sets whether the heading of self includes Pango markup.
Sets the appearance for response.
Sets whether response is enabled.
Sets the label of response to label.
Returns the fallback icon name for windows.
Returns a list of all existing toplevel windows.
Returns a list of all existing toplevel windows.
Sets whether the window should request startup notification.
Sets an icon to be used as fallback.
Opens or closes the interactive debugger.
Requests that the window is closed.
Drop the internal reference GTK holds on toplevel windows.
Asks to place window in the fullscreen state.
Asks to place window in the fullscreen state on the given monitor.
Gets the gtk.application.Application associated with the window.
Gets the child widget of window.
Returns whether the window has been set to have decorations.
Gets the default size of the window.
Returns the default widget for window.
Returns whether the window has been set to have a close button.
Returns whether the window will be destroyed with its transient parent.
Retrieves the current focused widget within the window.
Gets whether “focus rectangles” are supposed to be visible.
Returns the group for window.
Returns whether this window reacts to F10 key presses by activating a menubar it contains.
Returns whether the window will be hidden when the close button is clicked.
Returns the name of the themed icon for the window.
Gets whether mnemonics are supposed to be visible.
Returns whether the window is modal.
Gets the value set by gtk.window.Window.setResizable.
Retrieves the title of the window.
Returns the custom titlebar that has been set with gtk.window.Window.setTitlebar.
Fetches the transient parent for this window.
Returns whether window has an explicit window group.
Returns whether the window is part of the current active toplevel.
Retrieves the current fullscreen state of window.
Retrieves the current maximized state of window.
Retrieves the current suspended state of window.
Asks to maximize window, so that it fills the screen.
Asks to minimize the specified window.
Presents a window to the user.
Presents a window to the user in response to an user interaction.
Sets or unsets the gtk.application.Application associated with the window.
Sets the child widget of window.
Sets whether the window should be decorated.
Sets the default size of a window.
Sets the default widget.
Sets whether the window should be deletable.
If setting is true, then destroying the transient parent of window will also destroy window itself.
Sets the gdk.display.Display where the window is displayed.
Sets the focus widget.
Sets whether “focus rectangles” are supposed to be visible.
Sets whether this window should react to F10 key presses by activating a menubar it contains.
If setting is true, then clicking the close button on the window will not destroy it, but only hide it.
Sets the icon for the window from a named themed icon.
Sets whether mnemonics are supposed to be visible.
Sets a window modal or non-modal.
Sets whether the user can resize a window.
Sets the startup notification ID.
Sets the title of the gtk.window.Window.
Sets a custom titlebar for window.
Dialog windows should be set transient for the main application window they were spawned from. This allows window managers to e.g. keep the dialog on top of the main window, or center the dialog over the main window. gtk.dialog.Dialog.newWithButtons and other convenience functions in GTK will sometimes call gtk.window.Window.setTransientFor on your behalf.
Asks to remove the fullscreen state for window, and return to its previous state.
Asks to unmaximize window.
Asks to unminimize the specified window.
Connect to ActivateDefault signal.
Connect to ActivateFocus signal.
Connect to CloseRequest signal.
Connect to EnableDebugging signal.
Connect to KeysChanged signal.
A dialog presenting a message or a question.
<picture> <source srcset="message-dialog-dark.png" media="(prefers-color-scheme: dark)"> <img src="message-dialog.png" alt="message-dialog"> </picture>
Message dialogs have a heading, a body, an optional child widget, and one or multiple responses, each presented as a button.
Each response has a unique string ID, and a button label. Additionally, each response can be enabled or disabled, and can have a suggested or destructive appearance.
When one of the responses is activated, or the dialog is closed, the signal@MessageDialog::response signal will be emitted. This signal is detailed, and the detail, as well as the response parameter will be set to the ID of the activated response, or to the value of the property@MessageDialog:close-response property if the dialog had been closed without activating any of the responses.
Response buttons can be presented horizontally or vertically depending on available space.
When a response is activated, adw.message_dialog.MessageDialog is closed automatically.
An example of using a message dialog:
Async API
adw.message_dialog.MessageDialog can also be used via the adw.message_dialog.MessageDialog.choose method. This API follows the GIO async pattern, and the result can be obtained by calling adw.message_dialog.MessageDialog.chooseFinish, for example:
AdwMessageDialog as GtkBuildable
adw.message_dialog.MessageDialog supports adding responses in UI definitions by via the <responses> element that may contain multiple <response> elements, each respresenting a response.
Each of the <response> elements must have the id attribute specifying the response ID. The contents of the element are used as the response label.
Response labels can be translated with the usual translatable, context and comments attributes.
The <response> elements can also have enabled and/or appearance attributes. See adw.message_dialog.MessageDialog.setResponseEnabled and adw.message_dialog.MessageDialog.setResponseAppearance for details.
Example of an adw.message_dialog.MessageDialog UI definition:
Accessibility
adw.message_dialog.MessageDialog uses the gtk.types.AccessibleRole.Dialog role.