gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.AlertDialog

Description

A GtkAlertDialog object collects the arguments that are needed to present a message to the user.

The message is shown with the alertDialogChoose function. This API follows the GIO async pattern, and the result can be obtained by calling alertDialogChooseFinish.

If you don't need to wait for a button to be clicked, you can use alertDialogShow.

Since: 4.10

Synopsis

Exported types

newtype AlertDialog Source #

Memory-managed wrapper type.

Constructors

AlertDialog (ManagedPtr AlertDialog) 

Instances

Instances details
Eq AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

GObject AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

ManagedPtrNewtype AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

Methods

toManagedPtr :: AlertDialog -> ManagedPtr AlertDialog

TypedObject AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

Methods

glibType :: IO GType

HasParentTypes AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

IsGValue (Maybe AlertDialog) Source #

Convert AlertDialog to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.AlertDialog

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe AlertDialog -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe AlertDialog)

type ParentTypes AlertDialog Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

type ParentTypes AlertDialog = '[Object]

class (GObject o, IsDescendantOf AlertDialog o) => IsAlertDialog o Source #

Type class for types which can be safely cast to AlertDialog, for instance with toAlertDialog.

Instances

Instances details
(GObject o, IsDescendantOf AlertDialog o) => IsAlertDialog o Source # 
Instance details

Defined in GI.Gtk.Objects.AlertDialog

toAlertDialog :: (MonadIO m, IsAlertDialog o) => o -> m AlertDialog Source #

Cast to AlertDialog, for types for which this is known to be safe. For general casts, use castTo.

Methods

choose

alertDialogChoose Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a, IsWindow b, IsCancellable c) 
=> a

self: a GtkAlertDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

-> m () 

This function shows the alert to the user.

The callback will be called when the alert is dismissed. It should call alertDialogChooseFinish to obtain the result.

It is ok to pass NULL for the callback if the alert does not have more than one button. A simpler API for this case is alertDialogShow.

Since: 4.10

chooseFinish

alertDialogChooseFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a, IsAsyncResult b) 
=> a

self: a GtkAlertDialog

-> b

result: a GAsyncResult

-> m Int32

Returns: the index of the button that was clicked, or -1 if the dialog was cancelled and `AlertDialog:cancelButton is not set (Can throw GError)

Finishes the alertDialogChoose call and returns the index of the button that was clicked.

Since: 4.10

getButtons

alertDialogGetButtons Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m (Maybe [Text])

Returns: the button labels

Returns the button labels for the alert.

Since: 4.10

getCancelButton

alertDialogGetCancelButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m Int32

Returns: the index of the cancel button, or -1

Returns the index of the cancel button.

Since: 4.10

getDefaultButton

alertDialogGetDefaultButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m Int32

Returns: the index of the default button, or -1

Returns the index of the default button.

Since: 4.10

getDetail

alertDialogGetDetail Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m Text

Returns: the detail text

Returns the detail text that will be shown in the alert.

Since: 4.10

getMessage

alertDialogGetMessage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m Text

Returns: the message

Returns the message that will be shown in the alert.

Since: 4.10

getModal

alertDialogGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> m Bool

Returns: TRUE if the alert is modal

Returns whether the alert blocks interaction with the parent window while it is presented.

Since: 4.10

setButtons

alertDialogSetButtons Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> [Text]

labels: the new button labels

-> m () 

Sets the button labels for the alert.

Since: 4.10

setCancelButton

alertDialogSetCancelButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> Int32

button: the new cancel button

-> m () 

Sets the index of the cancel button.

See AlertDialog:cancelButton for details of how this value is used.

Since: 4.10

setDefaultButton

alertDialogSetDefaultButton Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> Int32

button: the new default button

-> m () 

Sets the index of the default button.

See AlertDialog:defaultButton for details of how this value is used.

Since: 4.10

setDetail

alertDialogSetDetail Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> Text

detail: the new detail text

-> m () 

Sets the detail text that will be shown in the alert.

Since: 4.10

setMessage

alertDialogSetMessage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> Text

message: the new message

-> m () 

Sets the message that will be shown in the alert.

Since: 4.10

setModal

alertDialogSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a) 
=> a

self: a GtkAlertDialog

-> Bool

modal: the new value

-> m () 

Sets whether the alert blocks interaction with the parent window while it is presented.

Since: 4.10

show

alertDialogShow Source #

Arguments

:: (HasCallStack, MonadIO m, IsAlertDialog a, IsWindow b) 
=> a

self: a GtkAlertDialog

-> Maybe b

parent: the parent GtkWindow

-> m () 

Show the alert to the user.

This function is a simple version of alertDialogChoose intended for dialogs with a single button. If you want to cancel the dialog or if the alert has more than one button, you should use that function instead and provide it with a Cancellable or callback respectively.

Since: 4.10

Properties

buttons

Labels for buttons to show in the alert.

The labels should be translated and may contain a _ to indicate the mnemonic character.

If this property is not set, then a 'Close' button is automatically created.

Since: 4.10

constructAlertDialogButtons :: (IsAlertDialog o, MonadIO m) => [Text] -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “buttons” property. This is rarely needed directly, but it is used by new.

getAlertDialogButtons :: (MonadIO m, IsAlertDialog o) => o -> m (Maybe [Text]) Source #

Get the value of the “buttons” property. When overloading is enabled, this is equivalent to

get alertDialog #buttons

setAlertDialogButtons :: (MonadIO m, IsAlertDialog o) => o -> [Text] -> m () Source #

Set the value of the “buttons” property. When overloading is enabled, this is equivalent to

set alertDialog [ #buttons := value ]

cancelButton

This property determines what happens when the Escape key is pressed while the alert is shown.

If this property holds the index of a button in AlertDialog:buttons, then pressing Escape is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then an error is returned.

If buttons is NULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.

Since: 4.10

constructAlertDialogCancelButton :: (IsAlertDialog o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cancel-button” property. This is rarely needed directly, but it is used by new.

getAlertDialogCancelButton :: (MonadIO m, IsAlertDialog o) => o -> m Int32 Source #

Get the value of the “cancel-button” property. When overloading is enabled, this is equivalent to

get alertDialog #cancelButton

setAlertDialogCancelButton :: (MonadIO m, IsAlertDialog o) => o -> Int32 -> m () Source #

Set the value of the “cancel-button” property. When overloading is enabled, this is equivalent to

set alertDialog [ #cancelButton := value ]

defaultButton

This property determines what happens when the Return key is pressed while the alert is shown.

If this property holds the index of a button in AlertDialog:buttons, then pressing Return is treated as if that button was pressed. If it is -1 or not a valid index for the buttons array, then nothing happens.

If buttons is NULL, then the automatically created 'Close' button is treated as both cancel and default button, so 0 is returned.

Since: 4.10

constructAlertDialogDefaultButton :: (IsAlertDialog o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “default-button” property. This is rarely needed directly, but it is used by new.

getAlertDialogDefaultButton :: (MonadIO m, IsAlertDialog o) => o -> m Int32 Source #

Get the value of the “default-button” property. When overloading is enabled, this is equivalent to

get alertDialog #defaultButton

setAlertDialogDefaultButton :: (MonadIO m, IsAlertDialog o) => o -> Int32 -> m () Source #

Set the value of the “default-button” property. When overloading is enabled, this is equivalent to

set alertDialog [ #defaultButton := value ]

detail

The detail text for the alert.

Since: 4.10

constructAlertDialogDetail :: (IsAlertDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “detail” property. This is rarely needed directly, but it is used by new.

getAlertDialogDetail :: (MonadIO m, IsAlertDialog o) => o -> m Text Source #

Get the value of the “detail” property. When overloading is enabled, this is equivalent to

get alertDialog #detail

setAlertDialogDetail :: (MonadIO m, IsAlertDialog o) => o -> Text -> m () Source #

Set the value of the “detail” property. When overloading is enabled, this is equivalent to

set alertDialog [ #detail := value ]

message

The message for the alert.

Since: 4.10

constructAlertDialogMessage :: (IsAlertDialog o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “message” property. This is rarely needed directly, but it is used by new.

getAlertDialogMessage :: (MonadIO m, IsAlertDialog o) => o -> m Text Source #

Get the value of the “message” property. When overloading is enabled, this is equivalent to

get alertDialog #message

setAlertDialogMessage :: (MonadIO m, IsAlertDialog o) => o -> Text -> m () Source #

Set the value of the “message” property. When overloading is enabled, this is equivalent to

set alertDialog [ #message := value ]

modal

Whether the alert is modal.

Since: 4.10

constructAlertDialogModal :: (IsAlertDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “modal” property. This is rarely needed directly, but it is used by new.

getAlertDialogModal :: (MonadIO m, IsAlertDialog o) => o -> m Bool Source #

Get the value of the “modal” property. When overloading is enabled, this is equivalent to

get alertDialog #modal

setAlertDialogModal :: (MonadIO m, IsAlertDialog o) => o -> Bool -> m () Source #

Set the value of the “modal” property. When overloading is enabled, this is equivalent to

set alertDialog [ #modal := value ]