Package ch.bailu.gtk.adw
Klasse MessageDialog
- Alle implementierten Schnittstellen:
PointerInterface
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, `AdwMessageDialog` is closed automatically.
An example of using a message dialog:
```c
GtkWidget *dialog;
dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
"cancel", _("_Cancel"),
"replace", _("_Replace"),
NULL);
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self);
gtk_window_present (GTK_WINDOW (dialog));
```
## Async API
`AdwMessageDialog` can also be used via the [method@MessageDialog.choose]
method. This API follows the GIO async pattern, for example:
```c
static void
dialog_cb (AdwMessageDialog *dialog,
GAsyncResult *result,
MyWindow *self)
{
const char *response = adw_message_dialog_choose_finish (dialog, result);
// ...
}
static void
show_dialog (MyWindow *self)
{
GtkWidget *dialog;
dialog = adw_message_dialog_new (GTK_WINDOW (self), _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
"cancel", _("_Cancel"),
"replace", _("_Replace"),
NULL);
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_choose (ADW_MESSAGE_DIALOG (dialog), NULL, (GAsyncReadyCallback) dialog_cb, self);
}
```
## AdwMessageDialog as GtkBuildable
`AdwMessageDialog` supports adding responses in UI definitions by via the
`<responses>` element that may contain multiple `<response>` elements, each
representing 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 [method@MessageDialog.set_response_enabled] and
[method@MessageDialog.set_response_appearance] for details.
Example of an `AdwMessageDialog` UI definition:
```xml
<object class="AdwMessageDialog" id="dialog">
<property name="heading" translatable="yes">Save Changes?</property>
<property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property>
<property name="default-response">save</property>
<property name="close-response">cancel</property>
<signal name="response" handler="response_cb"/>
<responses>
<response id="cancel" translatable="yes">_Cancel</response>
<response id="discard" translatable="yes" appearance="destructive">_Discard</response>
<response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response>
</responses>
</object>
```
## Accessibility
`AdwMessageDialog` uses the `GTK_ACCESSIBLE_ROLE_DIALOG` role.
<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, `AdwMessageDialog` is closed automatically.
An example of using a message dialog:
```c
GtkWidget *dialog;
dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
"cancel", _("_Cancel"),
"replace", _("_Replace"),
NULL);
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
g_signal_connect (dialog, "response", G_CALLBACK (response_cb), self);
gtk_window_present (GTK_WINDOW (dialog));
```
## Async API
`AdwMessageDialog` can also be used via the [method@MessageDialog.choose]
method. This API follows the GIO async pattern, for example:
```c
static void
dialog_cb (AdwMessageDialog *dialog,
GAsyncResult *result,
MyWindow *self)
{
const char *response = adw_message_dialog_choose_finish (dialog, result);
// ...
}
static void
show_dialog (MyWindow *self)
{
GtkWidget *dialog;
dialog = adw_message_dialog_new (GTK_WINDOW (self), _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
adw_message_dialog_add_responses (ADW_MESSAGE_DIALOG (dialog),
"cancel", _("_Cancel"),
"replace", _("_Replace"),
NULL);
adw_message_dialog_set_response_appearance (ADW_MESSAGE_DIALOG (dialog), "replace", ADW_RESPONSE_DESTRUCTIVE);
adw_message_dialog_set_default_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_set_close_response (ADW_MESSAGE_DIALOG (dialog), "cancel");
adw_message_dialog_choose (ADW_MESSAGE_DIALOG (dialog), NULL, (GAsyncReadyCallback) dialog_cb, self);
}
```
## AdwMessageDialog as GtkBuildable
`AdwMessageDialog` supports adding responses in UI definitions by via the
`<responses>` element that may contain multiple `<response>` elements, each
representing 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 [method@MessageDialog.set_response_enabled] and
[method@MessageDialog.set_response_appearance] for details.
Example of an `AdwMessageDialog` UI definition:
```xml
<object class="AdwMessageDialog" id="dialog">
<property name="heading" translatable="yes">Save Changes?</property>
<property name="body" translatable="yes">Open documents contain unsaved changes. Changes which are not saved will be permanently lost.</property>
<property name="default-response">save</property>
<property name="close-response">cancel</property>
<signal name="response" handler="response_cb"/>
<responses>
<response id="cancel" translatable="yes">_Cancel</response>
<response id="discard" translatable="yes" appearance="destructive">_Discard</response>
<response id="save" translatable="yes" appearance="suggested" enabled="false">_Save</response>
</responses>
</object>
```
## Accessibility
`AdwMessageDialog` uses the `GTK_ACCESSIBLE_ROLE_DIALOG` role.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.MessageDialog.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Window
Window.OnActivateDefault, Window.OnActivateFocus, Window.OnCloseRequest, Window.OnEnableDebugging, Window.OnKeysChanged
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gtk.Window
SIGNAL_ON_ACTIVATE_DEFAULT, SIGNAL_ON_ACTIVATE_FOCUS, SIGNAL_ON_CLOSE_REQUEST, SIGNAL_ON_ENABLE_DEBUGGING, SIGNAL_ON_KEYS_CHANGED
Von Klasse geerbte Felder ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungMessageDialog
(Window parent, Str heading, Str body) Veraltet.MessageDialog
(Window parent, String heading, String body) Veraltet.MessageDialog
(PointerContainer pointer) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addResponse
(Str id, Str label) Veraltet.void
addResponse
(String id, String label) Veraltet.void
addResponses
(Str first_id, Object... _ellipsis) Veraltet.void
addResponses
(String first_id, Object... _ellipsis) Veraltet.Implements interfaceAccessible
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.asNative()
Implements interfaceNative
.asRoot()
Implements interfaceRoot
.Implements interfaceShortcutManager
.void
choose
(Cancellable cancellable, MessageDialog.OnAsyncReadyCallback callback, Pointer user_data) Veraltet.chooseFinish
(AsyncResult result) Veraltet.void
formatBody
(Str format, Object... _ellipsis) Veraltet.void
formatBody
(String format, Object... _ellipsis) Veraltet.void
formatBodyMarkup
(Str format, Object... _ellipsis) Veraltet.void
formatBodyMarkup
(String format, Object... _ellipsis) Veraltet.void
formatHeading
(Str format, Object... _ellipsis) Veraltet.void
formatHeading
(String format, Object... _ellipsis) Veraltet.void
formatHeadingMarkup
(Str format, Object... _ellipsis) Veraltet.void
formatHeadingMarkup
(String format, Object... _ellipsis) Veraltet.getBody()
Veraltet.boolean
Veraltet.static ClassHandler
Veraltet.Veraltet.Veraltet.Veraltet.boolean
Veraltet.static int
static long
static TypeSystem.TypeSize
int
getResponseAppearance
(Str response) Veraltet.int
getResponseAppearance
(String response) Veraltet.boolean
getResponseEnabled
(Str response) Veraltet.boolean
getResponseEnabled
(String response) Veraltet.getResponseLabel
(Str response) Veraltet.getResponseLabel
(String response) Veraltet.static long
static TypeSystem.TypeSize
boolean
hasResponse
(Str response) Veraltet.boolean
hasResponse
(String response) Veraltet.onResponse
(MessageDialog.OnResponse signal) Connect to signal "response".void
removeResponse
(Str id) Veraltet.void
removeResponse
(String id) Veraltet.void
Veraltet.void
Veraltet.void
Veraltet.void
Veraltet.void
setBodyUseMarkup
(boolean use_markup) Veraltet.void
setCloseResponse
(Str response) Veraltet.void
setCloseResponse
(String response) Veraltet.void
setDefaultResponse
(Str response) Veraltet.void
setDefaultResponse
(String response) Veraltet.void
setExtraChild
(Widget child) Veraltet.void
setHeading
(Str heading) Veraltet.void
setHeading
(String heading) Veraltet.void
setHeadingUseMarkup
(boolean use_markup) Veraltet.void
setResponseAppearance
(Str response, int appearance) Veraltet.void
setResponseAppearance
(String response, int appearance) Veraltet.void
setResponseEnabled
(Str response, boolean enabled) Veraltet.void
setResponseEnabled
(String response, boolean enabled) Veraltet.void
setResponseLabel
(Str response, Str label) Veraltet.void
setResponseLabel
(String response, String label) Veraltet.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Window
close, destroy, fullscreen, fullscreenOnMonitor, getApplication, getChild, getDecorated, getDefaultIconName, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getFocus, getFocusVisible, getGroup, getHandleMenubarAccel, getHideOnClose, getIconName, getMnemonicsVisible, getModal, getResizable, getTitle, getTitlebar, getToplevels, getTransientFor, hasGroup, isActive, isFullscreen, isMaximized, isSuspended, listToplevels, maximize, minimize, onActivateDefault, onActivateFocus, onCloseRequest, onEnableDebugging, onKeysChanged, present, presentWithTime, setApplication, setAutoStartupNotification, setChild, setDecorated, setDefaultIconName, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDisplay, setFocus, setFocusVisible, setHandleMenubarAccel, setHideOnClose, setIconName, setIconName, setInteractiveDebugging, setMnemonicsVisible, setModal, setResizable, setStartupId, setStartupId, setTitle, setTitle, setTitlebar, setTransientFor, unfullscreen, unmaximize, unminimize
Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_RESPONSE
Veraltet.- Siehe auch:
-
-
Konstruktordetails
-
MessageDialog
-
MessageDialog
@Deprecated public MessageDialog(@Nullable Window parent, @Nullable Str heading, @Nullable Str body) Veraltet.Creates a new `AdwMessageDialog`.
@heading and @body can be set to `NULL`. This can be useful if they need to
be formatted or use markup. In that case, set them to `NULL` and call
[method@MessageDialog.format_body] or similar methods afterwards:
```c
GtkWidget *dialog;
dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
```- Parameter:
parent
- transient parentheading
- the headingbody
- the body text
-
MessageDialog
Veraltet.Creates a new `AdwMessageDialog`.
@heading and @body can be set to `NULL`. This can be useful if they need to
be formatted or use markup. In that case, set them to `NULL` and call
[method@MessageDialog.format_body] or similar methods afterwards:
```c
GtkWidget *dialog;
dialog = adw_message_dialog_new (parent, _("Replace File?"), NULL);
adw_message_dialog_format_body (ADW_MESSAGE_DIALOG (dialog),
_("A file named “%s” already exists. Do you want to replace it?"),
filename);
```- Parameter:
parent
- transient parentheading
- the headingbody
- the body text
-
-
Methodendetails
-
getClassHandler
-
addResponse
Veraltet.Adds a response with @id and @label to @self.
Responses are represented as buttons in the dialog.
Response ID must be unique. It will be used in
[signal@MessageDialog::response] to tell which response had been activated,
as well as to inspect and modify the response later.
An embedded underline in @label indicates a mnemonic.
[method@MessageDialog.set_response_label] can be used to change the response
label after it had been added.
[method@MessageDialog.set_response_enabled] and
[method@MessageDialog.set_response_appearance] can be used to customize the
responses further.- Parameter:
id
- the response IDlabel
- the response label
-
addResponse
Veraltet.Adds a response with @id and @label to @self.
Responses are represented as buttons in the dialog.
Response ID must be unique. It will be used in
[signal@MessageDialog::response] to tell which response had been activated,
as well as to inspect and modify the response later.
An embedded underline in @label indicates a mnemonic.
[method@MessageDialog.set_response_label] can be used to change the response
label after it had been added.
[method@MessageDialog.set_response_enabled] and
[method@MessageDialog.set_response_appearance] can be used to customize the
responses further.- Parameter:
id
- the response IDlabel
- the response label
-
addResponses
Veraltet.Adds multiple responses to @self.
This is the same as calling [method@MessageDialog.add_response] repeatedly.
The variable argument list should be `NULL`-terminated list of response IDs
and labels.
Example:
```c
adw_message_dialog_add_responses (dialog,
"cancel", _("_Cancel"),
"discard", _("_Discard"),
"save", _("_Save"),
NULL);
```- Parameter:
first_id
- response id_ellipsis
- label for first response, then more id-label pairs
-
addResponses
Veraltet.Adds multiple responses to @self.
This is the same as calling [method@MessageDialog.add_response] repeatedly.
The variable argument list should be `NULL`-terminated list of response IDs
and labels.
Example:
```c
adw_message_dialog_add_responses (dialog,
"cancel", _("_Cancel"),
"discard", _("_Discard"),
"save", _("_Save"),
NULL);
```- Parameter:
first_id
- response id_ellipsis
- label for first response, then more id-label pairs
-
choose
@Deprecated public void choose(@Nullable Cancellable cancellable, MessageDialog.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Veraltet.This function shows @self to the user.- Parameter:
cancellable
- a `GCancellable` to cancel the operationcallback
- a callback to call when the operation is completeuser_data
- data to pass to @callback
-
chooseFinish
Veraltet.Finishes the [method@MessageDialog.choose] call and returns the response ID.- Parameter:
result
- a `GAsyncResult`- Gibt zurück:
- the ID of the response that was selected, or [property@MessageDialog:close-response] if the call was cancelled.
-
formatBody
Veraltet.Sets the formatted body text of @self.
See [property@MessageDialog:body].- Parameter:
format
- the formatted string for the body text_ellipsis
- the parameters to insert into @format
-
formatBody
Veraltet.Sets the formatted body text of @self.
See [property@MessageDialog:body].- Parameter:
format
- the formatted string for the body text_ellipsis
- the parameters to insert into @format
-
formatBodyMarkup
Veraltet.Sets the formatted body text of @self with Pango markup.
The @format is assumed to contain Pango markup.
Special XML characters in the `printf()` arguments passed to this function
will automatically be escaped as necessary, see
[func@GLib.markup_printf_escaped].
See [property@MessageDialog:body].- Parameter:
format
- the formatted string for the body text with Pango markup_ellipsis
- the parameters to insert into @format
-
formatBodyMarkup
Veraltet.Sets the formatted body text of @self with Pango markup.
The @format is assumed to contain Pango markup.
Special XML characters in the `printf()` arguments passed to this function
will automatically be escaped as necessary, see
[func@GLib.markup_printf_escaped].
See [property@MessageDialog:body].- Parameter:
format
- the formatted string for the body text with Pango markup_ellipsis
- the parameters to insert into @format
-
formatHeading
Veraltet.Sets the formatted heading of @self.
See [property@MessageDialog:heading].- Parameter:
format
- the formatted string for the heading_ellipsis
- the parameters to insert into @format
-
formatHeading
Veraltet.Sets the formatted heading of @self.
See [property@MessageDialog:heading].- Parameter:
format
- the formatted string for the heading_ellipsis
- the parameters to insert into @format
-
formatHeadingMarkup
Veraltet.Sets the formatted heading of @self with Pango markup.
The @format is assumed to contain Pango markup.
Special XML characters in the `printf()` arguments passed to this function
will automatically be escaped as necessary, see
[func@GLib.markup_printf_escaped].
See [property@MessageDialog:heading].- Parameter:
format
- the formatted string for the heading with Pango markup_ellipsis
- the parameters to insert into @format
-
formatHeadingMarkup
Veraltet.Sets the formatted heading of @self with Pango markup.
The @format is assumed to contain Pango markup.
Special XML characters in the `printf()` arguments passed to this function
will automatically be escaped as necessary, see
[func@GLib.markup_printf_escaped].
See [property@MessageDialog:heading].- Parameter:
format
- the formatted string for the heading with Pango markup_ellipsis
- the parameters to insert into @format
-
getBody
Veraltet.Gets the body text of @self.- Gibt zurück:
- the body of @self.
-
getBodyUseMarkup
Veraltet.Gets whether the body text of @self includes Pango markup.- Gibt zurück:
- whether @self uses markup for body text
-
getCloseResponse
Veraltet.Gets the ID of the close response of @self.- Gibt zurück:
- the close response ID
-
getDefaultResponse
Veraltet.Gets the ID of the default response of @self.- Gibt zurück:
- the default response ID
-
getExtraChild
Veraltet.Gets the child widget of @self.- Gibt zurück:
- the child widget of @self.
-
getHeading
Veraltet.Gets the heading of @self.- Gibt zurück:
- the heading of @self.
-
getHeadingUseMarkup
Veraltet.Gets whether the heading of @self includes Pango markup.- Gibt zurück:
- whether @self uses markup for heading
-
getResponseAppearance
Veraltet.Gets the appearance of @response.
See [method@MessageDialog.set_response_appearance].- Parameter:
response
- a response ID- Gibt zurück:
- the appearance of @response
-
getResponseAppearance
Veraltet.Gets the appearance of @response.
See [method@MessageDialog.set_response_appearance].- Parameter:
response
- a response ID- Gibt zurück:
- the appearance of @response
-
getResponseEnabled
Veraltet.Gets whether @response is enabled.
See [method@MessageDialog.set_response_enabled].- Parameter:
response
- a response ID- Gibt zurück:
- whether @response is enabled
-
getResponseEnabled
Veraltet.Gets whether @response is enabled.
See [method@MessageDialog.set_response_enabled].- Parameter:
response
- a response ID- Gibt zurück:
- whether @response is enabled
-
getResponseLabel
Veraltet.Gets the label of @response.
See [method@MessageDialog.set_response_label].- Parameter:
response
- a response ID- Gibt zurück:
- the label of @response
-
getResponseLabel
Veraltet.Gets the label of @response.
See [method@MessageDialog.set_response_label].- Parameter:
response
- a response ID- Gibt zurück:
- the label of @response
-
hasResponse
Veraltet.Gets whether @self has a response with the ID @response.- Parameter:
response
- response ID- Gibt zurück:
- whether @self has a response with the ID @response.
-
hasResponse
Veraltet.Gets whether @self has a response with the ID @response.- Parameter:
response
- response ID- Gibt zurück:
- whether @self has a response with the ID @response.
-
removeResponse
Veraltet.Removes a response from @self.- Parameter:
id
- the response ID
-
removeResponse
Veraltet.Removes a response from @self.- Parameter:
id
- the response ID
-
response
Veraltet.Emits the [signal@MessageDialog::response] signal with the given response ID.
Used to indicate that the user has responded to the dialog in some way.- Parameter:
response
- response ID
-
response
Veraltet.Emits the [signal@MessageDialog::response] signal with the given response ID.
Used to indicate that the user has responded to the dialog in some way.- Parameter:
response
- response ID
-
setBody
Veraltet.Sets the body text of @self.- Parameter:
body
- the body of @self
-
setBody
Veraltet.Sets the body text of @self.- Parameter:
body
- the body of @self
-
setBodyUseMarkup
Veraltet.Sets whether the body text of @self includes Pango markup.
See [func@Pango.parse_markup].- Parameter:
use_markup
- whether to use markup for body text
-
setCloseResponse
Veraltet.Sets the ID of the close response of @self.
It will be passed to [signal@MessageDialog::response] if the window is
closed by pressing <kbd>Escape</kbd> or with a system action.
It doesn't have to correspond to any of the responses in the dialog.
The default close response is `close`.- Parameter:
response
- the close response ID
-
setCloseResponse
Veraltet.Sets the ID of the close response of @self.
It will be passed to [signal@MessageDialog::response] if the window is
closed by pressing <kbd>Escape</kbd> or with a system action.
It doesn't have to correspond to any of the responses in the dialog.
The default close response is `close`.- Parameter:
response
- the close response ID
-
setDefaultResponse
Veraltet.Sets the ID of the default response of @self.
If set, pressing <kbd>Enter</kbd> will activate the corresponding button.
If set to `NULL` or to a non-existent response ID, pressing <kbd>Enter</kbd>
will do nothing.- Parameter:
response
- the default response ID
-
setDefaultResponse
Veraltet.Sets the ID of the default response of @self.
If set, pressing <kbd>Enter</kbd> will activate the corresponding button.
If set to `NULL` or to a non-existent response ID, pressing <kbd>Enter</kbd>
will do nothing.- Parameter:
response
- the default response ID
-
setExtraChild
Veraltet.Sets the child widget of @self.
The child widget is displayed below the heading and body.- Parameter:
child
- the child widget
-
setHeading
Veraltet.Sets the heading of @self.- Parameter:
heading
- the heading of @self
-
setHeading
Veraltet.Sets the heading of @self.- Parameter:
heading
- the heading of @self
-
setHeadingUseMarkup
Veraltet.Sets whether the heading of @self includes Pango markup.
See [func@Pango.parse_markup].- Parameter:
use_markup
- whether to use markup for heading
-
setResponseAppearance
Veraltet.Sets the appearance for @response.
<picture>
<source srcset="message-dialog-appearance-dark.png" media="(prefers-color-scheme: dark)">
<img src="message-dialog-appearance.png" alt="message-dialog-appearance">
</picture>
Use `ADW_RESPONSE_SUGGESTED` to mark important responses such as the
affirmative action, like the Save button in the example.
Use `ADW_RESPONSE_DESTRUCTIVE` to draw attention to the potentially damaging
consequences of using @response. This appearance acts as a warning to the
user. The Discard button in the example is using this appearance.
The default appearance is `ADW_RESPONSE_DEFAULT`.
Negative responses like Cancel or Close should use the default appearance.- Parameter:
response
- a response IDappearance
- appearance for @response
-
setResponseAppearance
Veraltet.Sets the appearance for @response.
<picture>
<source srcset="message-dialog-appearance-dark.png" media="(prefers-color-scheme: dark)">
<img src="message-dialog-appearance.png" alt="message-dialog-appearance">
</picture>
Use `ADW_RESPONSE_SUGGESTED` to mark important responses such as the
affirmative action, like the Save button in the example.
Use `ADW_RESPONSE_DESTRUCTIVE` to draw attention to the potentially damaging
consequences of using @response. This appearance acts as a warning to the
user. The Discard button in the example is using this appearance.
The default appearance is `ADW_RESPONSE_DEFAULT`.
Negative responses like Cancel or Close should use the default appearance.- Parameter:
response
- a response IDappearance
- appearance for @response
-
setResponseEnabled
Veraltet.Sets whether @response is enabled.
If @response is not enabled, the corresponding button will have
[property@Gtk.Widget:sensitive] set to `FALSE` and it can't be activated as
a default response.
@response can still be used as [property@MessageDialog:close-response] while
it's not enabled.
Responses are enabled by default.- Parameter:
response
- a response IDenabled
- whether to enable @response
-
setResponseEnabled
Veraltet.Sets whether @response is enabled.
If @response is not enabled, the corresponding button will have
[property@Gtk.Widget:sensitive] set to `FALSE` and it can't be activated as
a default response.
@response can still be used as [property@MessageDialog:close-response] while
it's not enabled.
Responses are enabled by default.- Parameter:
response
- a response IDenabled
- whether to enable @response
-
setResponseLabel
Veraltet.Sets the label of @response to @label.
Labels are displayed on the dialog buttons. An embedded underline in @label
indicates a mnemonic.- Parameter:
response
- a response IDlabel
- the label of @response
-
setResponseLabel
Veraltet.Sets the label of @response to @label.
Labels are displayed on the dialog buttons. An embedded underline in @label
indicates a mnemonic.- Parameter:
response
- a response IDlabel
- the label of @response
-
onResponse
Connect to signal "response".
SeeMessageDialog.OnResponse.onResponse(ch.bailu.gtk.type.Str)
for signal description.
FieldSIGNAL_ON_RESPONSE
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessible
in KlasseWindow
- Gibt zurück:
Accessible
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildable
in KlasseWindow
- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTarget
in KlasseWindow
- Gibt zurück:
ConstraintTarget
-
asNative
Implements interfaceNative
. Call this to get access to interface functions. -
asRoot
Implements interfaceRoot
. Call this to get access to interface functions. -
asShortcutManager
Implements interfaceShortcutManager
. Call this to get access to interface functions.- Setzt außer Kraft:
asShortcutManager
in KlasseWindow
- Gibt zurück:
ShortcutManager
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-