Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- addResponse
- getBody
- getBodyUseMarkup
- getCloseResponse
- getDefaultResponse
- getExtraChild
- getHeading
- getHeadingUseMarkup
- getResponseAppearance
- getResponseEnabled
- getResponseLabel
- hasResponse
- new
- response
- setBody
- setBodyUseMarkup
- setCloseResponse
- setDefaultResponse
- setExtraChild
- setHeading
- setHeadingUseMarkup
- setResponseAppearance
- setResponseEnabled
- setResponseLabel
- Properties
- Signals
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
signalmessageDialog
[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
[propertymessageDialog
: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 code
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));
AdwMessageDialog as GtkBuildable
AdwMessageDialog
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 [methodmessageDialog
.set_response_enabled] and
[methodmessageDialog
.set_response_appearance] for details.
Example of an AdwMessageDialog
UI definition:
xml code
<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.
Since: 1.2
Synopsis
- newtype MessageDialog = MessageDialog (ManagedPtr MessageDialog)
- class (GObject o, IsDescendantOf MessageDialog o) => IsMessageDialog o
- toMessageDialog :: (MonadIO m, IsMessageDialog o) => o -> m MessageDialog
- messageDialogAddResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> Text -> m ()
- messageDialogGetBody :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m Text
- messageDialogGetBodyUseMarkup :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m Bool
- messageDialogGetCloseResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m Text
- messageDialogGetDefaultResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m (Maybe Text)
- messageDialogGetExtraChild :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m (Maybe Widget)
- messageDialogGetHeading :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m (Maybe Text)
- messageDialogGetHeadingUseMarkup :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> m Bool
- messageDialogGetResponseAppearance :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m ResponseAppearance
- messageDialogGetResponseEnabled :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m Bool
- messageDialogGetResponseLabel :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m Text
- messageDialogHasResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m Bool
- messageDialogNew :: (HasCallStack, MonadIO m, IsWindow a) => Maybe a -> Maybe Text -> Maybe Text -> m MessageDialog
- messageDialogResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m ()
- messageDialogSetBody :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m ()
- messageDialogSetBodyUseMarkup :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Bool -> m ()
- messageDialogSetCloseResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> m ()
- messageDialogSetDefaultResponse :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Maybe Text -> m ()
- messageDialogSetExtraChild :: (HasCallStack, MonadIO m, IsMessageDialog a, IsWidget b) => a -> Maybe b -> m ()
- messageDialogSetHeading :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Maybe Text -> m ()
- messageDialogSetHeadingUseMarkup :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Bool -> m ()
- messageDialogSetResponseAppearance :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> ResponseAppearance -> m ()
- messageDialogSetResponseEnabled :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> Bool -> m ()
- messageDialogSetResponseLabel :: (HasCallStack, MonadIO m, IsMessageDialog a) => a -> Text -> Text -> m ()
- constructMessageDialogBody :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageDialogBody :: (MonadIO m, IsMessageDialog o) => o -> m Text
- setMessageDialogBody :: (MonadIO m, IsMessageDialog o) => o -> Text -> m ()
- constructMessageDialogBodyUseMarkup :: (IsMessageDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMessageDialogBodyUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> m Bool
- setMessageDialogBodyUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> Bool -> m ()
- constructMessageDialogCloseResponse :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageDialogCloseResponse :: (MonadIO m, IsMessageDialog o) => o -> m Text
- setMessageDialogCloseResponse :: (MonadIO m, IsMessageDialog o) => o -> Text -> m ()
- clearMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> m ()
- constructMessageDialogDefaultResponse :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Text)
- setMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> Text -> m ()
- clearMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o) => o -> m ()
- constructMessageDialogExtraChild :: (IsMessageDialog o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Widget)
- setMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o, IsWidget a) => o -> a -> m ()
- clearMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> m ()
- constructMessageDialogHeading :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Text)
- setMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> Text -> m ()
- constructMessageDialogHeadingUseMarkup :: (IsMessageDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getMessageDialogHeadingUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> m Bool
- setMessageDialogHeadingUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> Bool -> m ()
- type MessageDialogResponseCallback = Text -> IO ()
- afterMessageDialogResponse :: (IsMessageDialog a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MessageDialogResponseCallback) -> m SignalHandlerId
- onMessageDialogResponse :: (IsMessageDialog a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MessageDialogResponseCallback) -> m SignalHandlerId
Exported types
newtype MessageDialog Source #
Memory-managed wrapper type.
MessageDialog (ManagedPtr MessageDialog) |
Instances
class (GObject o, IsDescendantOf MessageDialog o) => IsMessageDialog o Source #
Type class for types which can be safely cast to MessageDialog
, for instance with toMessageDialog
.
Instances
(GObject o, IsDescendantOf MessageDialog o) => IsMessageDialog o Source # | |
Defined in GI.Adw.Objects.MessageDialog |
toMessageDialog :: (MonadIO m, IsMessageDialog o) => o -> m MessageDialog Source #
Cast to MessageDialog
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addResponse, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, close, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, destroy, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasGroup, hasResponse, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isActive, isAncestor, isDrawable, isFloating, isFocus, isFullscreen, isMaximized, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, maximize, measure, minimize, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, present, presentWithTime, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, response, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unminimize, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getApplication, getBody, getBodyUseMarkup, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCloseResponse, getCssClasses, getCssName, getCursor, getData, getDecorated, getDefaultResponse, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDirection, getDisplay, getExtraChild, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusVisible, getFocusable, getFontMap, getFontOptions, getFrameClock, getGroup, getHalign, getHandleMenubarAccel, getHasTooltip, getHeading, getHeadingUseMarkup, getHeight, getHexpand, getHexpandSet, getHideOnClose, getIconName, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMnemonicsVisible, getModal, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getResizable, getResponseAppearance, getResponseEnabled, getResponseLabel, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTransientFor, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setApplication, setBody, setBodyUseMarkup, setCanFocus, setCanTarget, setChild, setChildVisible, setCloseResponse, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDecorated, setDefaultResponse, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDirection, setDisplay, setExtraChild, setFocus, setFocusChild, setFocusOnClick, setFocusVisible, setFocusable, setFontMap, setFontOptions, setHalign, setHandleMenubarAccel, setHasTooltip, setHeading, setHeadingUseMarkup, setHexpand, setHexpandSet, setHideOnClose, setIconName, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMnemonicsVisible, setModal, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setResizable, setResponseAppearance, setResponseEnabled, setResponseLabel, setSensitive, setSizeRequest, setStartupId, setStateFlags, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTransientFor, setValign, setVexpand, setVexpandSet, setVisible.
addResponse
messageDialogAddResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
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
signalmessageDialog
[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.
Since: 1.2
getBody
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m Text | Returns: the body of |
Gets the body text of self
.
Since: 1.2
getBodyUseMarkup
messageDialogGetBodyUseMarkup Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether the body text of self
includes Pango markup.
Since: 1.2
getCloseResponse
messageDialogGetCloseResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m Text | Returns: the close response ID |
Gets the ID of the close response of self
.
Since: 1.2
getDefaultResponse
messageDialogGetDefaultResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m (Maybe Text) | Returns: the default response ID |
Gets the ID of the default response of self
.
Since: 1.2
getExtraChild
messageDialogGetExtraChild Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the child widget of |
Gets the child widget of self
.
Since: 1.2
getHeading
messageDialogGetHeading Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m (Maybe Text) | Returns: the heading of |
Gets the heading of self
.
Since: 1.2
getHeadingUseMarkup
messageDialogGetHeadingUseMarkup Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether the heading of self
includes Pango markup.
Since: 1.2
getResponseAppearance
messageDialogGetResponseAppearance Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m ResponseAppearance | Returns: the appearance of |
Gets the appearance of response
.
See [methodmessageDialog
.set_response_appearance].
Since: 1.2
getResponseEnabled
messageDialogGetResponseEnabled Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: whether |
Gets whether response
is enabled.
See [methodmessageDialog
.set_response_enabled].
Since: 1.2
getResponseLabel
messageDialogGetResponseLabel Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m Text | Returns: the label of |
Gets the label of response
.
See [methodmessageDialog
.set_response_label].
Since: 1.2
hasResponse
messageDialogHasResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m Bool | Returns: whether |
Gets whether self
has a response with the ID response
.
Since: 1.2
new
:: (HasCallStack, MonadIO m, IsWindow a) | |
=> Maybe a |
|
-> Maybe Text |
|
-> Maybe Text |
|
-> m MessageDialog | Returns: the newly created |
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
[methodmessageDialog
.format_body] or similar methods afterwards:
c code
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);
Since: 1.2
response
messageDialogResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Emits the signalmessageDialog
[response] signal with the given response ID.
Used to indicate that the user has responded to the dialog in some way.
Since: 1.2
setBody
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the body text of self
.
Since: 1.2
setBodyUseMarkup
messageDialogSetBodyUseMarkup Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
setCloseResponse
messageDialogSetCloseResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the ID of the close response of self
.
It will be passed to signalmessageDialog
[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
.
Since: 1.2
setDefaultResponse
messageDialogSetDefaultResponse Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
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.
Since: 1.2
setExtraChild
messageDialogSetExtraChild Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the child widget of self
.
The child widget is displayed below the heading and body.
Since: 1.2
setHeading
messageDialogSetHeading Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
Sets the heading of self
.
Since: 1.2
setHeadingUseMarkup
messageDialogSetHeadingUseMarkup Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
setResponseAppearance
messageDialogSetResponseAppearance Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> ResponseAppearance |
|
-> m () |
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.
Since: 1.2
setResponseEnabled
messageDialogSetResponseEnabled Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> Bool |
|
-> m () |
Sets whether response
is enabled.
If response
is not enabled, the corresponding button will have
Widget:sensitive set to FALSE
and it can't be activated as
a default response.
response
can still be used as [propertymessageDialog
:close-response] while
it's not enabled.
Responses are enabled by default.
Since: 1.2
setResponseLabel
messageDialogSetResponseLabel Source #
:: (HasCallStack, MonadIO m, IsMessageDialog a) | |
=> a |
|
-> Text |
|
-> Text |
|
-> m () |
Sets the label of response
to label
.
Labels are displayed on the dialog buttons. An embedded underline in label
indicates a mnemonic.
Since: 1.2
Properties
body
The body text of the dialog.
Since: 1.2
constructMessageDialogBody :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “body
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogBody :: (MonadIO m, IsMessageDialog o) => o -> m Text Source #
Get the value of the “body
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #body
setMessageDialogBody :: (MonadIO m, IsMessageDialog o) => o -> Text -> m () Source #
Set the value of the “body
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #body:=
value ]
bodyUseMarkup
constructMessageDialogBodyUseMarkup :: (IsMessageDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “body-use-markup
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogBodyUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> m Bool Source #
Get the value of the “body-use-markup
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #bodyUseMarkup
setMessageDialogBodyUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> Bool -> m () Source #
Set the value of the “body-use-markup
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #bodyUseMarkup:=
value ]
closeResponse
The ID of the close response.
It will be passed to signalmessageDialog
[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
.
Since: 1.2
constructMessageDialogCloseResponse :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “close-response
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogCloseResponse :: (MonadIO m, IsMessageDialog o) => o -> m Text Source #
Get the value of the “close-response
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #closeResponse
setMessageDialogCloseResponse :: (MonadIO m, IsMessageDialog o) => o -> Text -> m () Source #
Set the value of the “close-response
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #closeResponse:=
value ]
defaultResponse
The response ID of the default response.
If set, pressing <kbd>Enter</kbd> will activate the corresponding button.
If set to NULL
or a non-existent response ID, pressing <kbd>Enter</kbd>
will do nothing.
Since: 1.2
clearMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> m () Source #
Set the value of the “default-response
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#defaultResponse
constructMessageDialogDefaultResponse :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “default-response
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Text) Source #
Get the value of the “default-response
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #defaultResponse
setMessageDialogDefaultResponse :: (MonadIO m, IsMessageDialog o) => o -> Text -> m () Source #
Set the value of the “default-response
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #defaultResponse:=
value ]
extraChild
The child widget.
Displayed below the heading and body.
Since: 1.2
clearMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o) => o -> m () Source #
Set the value of the “extra-child
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#extraChild
constructMessageDialogExtraChild :: (IsMessageDialog o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “extra-child
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Widget) Source #
Get the value of the “extra-child
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #extraChild
setMessageDialogExtraChild :: (MonadIO m, IsMessageDialog o, IsWidget a) => o -> a -> m () Source #
Set the value of the “extra-child
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #extraChild:=
value ]
heading
The heading of the dialog.
Since: 1.2
clearMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> m () Source #
Set the value of the “heading
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#heading
constructMessageDialogHeading :: (IsMessageDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “heading
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> m (Maybe Text) Source #
Get the value of the “heading
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #heading
setMessageDialogHeading :: (MonadIO m, IsMessageDialog o) => o -> Text -> m () Source #
Set the value of the “heading
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #heading:=
value ]
headingUseMarkup
constructMessageDialogHeadingUseMarkup :: (IsMessageDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “heading-use-markup
” property. This is rarely needed directly, but it is used by new
.
getMessageDialogHeadingUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> m Bool Source #
Get the value of the “heading-use-markup
” property.
When overloading is enabled, this is equivalent to
get
messageDialog #headingUseMarkup
setMessageDialogHeadingUseMarkup :: (MonadIO m, IsMessageDialog o) => o -> Bool -> m () Source #
Set the value of the “heading-use-markup
” property.
When overloading is enabled, this is equivalent to
set
messageDialog [ #headingUseMarkup:=
value ]
Signals
response
type MessageDialogResponseCallback Source #
This signal is emitted when the dialog is closed.
response
will be set to the response ID of the button that had been
activated.
if the dialog was closed by pressing <kbd>Escape</kbd> or with a system
action, response
will be set to the value of
[propertymessageDialog
:close-response].
Since: 1.2
afterMessageDialogResponse :: (IsMessageDialog a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MessageDialogResponseCallback) -> m SignalHandlerId Source #
Connect a signal handler for the response signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
messageDialog #response callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “response::detail
” instead.
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onMessageDialogResponse :: (IsMessageDialog a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MessageDialogResponseCallback) -> m SignalHandlerId Source #
Connect a signal handler for the response signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
messageDialog #response callback
This signal admits a optional parameter detail
.
If it's not Nothing
, we will connect to “response::detail
” instead.