gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.MessageDialog

Contents

Description

MessageDialog presents a dialog with some message text. It’s simply a convenience widget; you could construct the equivalent of MessageDialog from Dialog without too much effort, but MessageDialog saves typing.

One difference from Dialog is that MessageDialog sets the Window:skip-taskbar-hint property to True, so that the dialog is hidden from the taskbar by default.

The easiest way to do a modal message dialog is to use dialogRun, though you can also pass in the DialogFlagsModal flag, dialogRun automatically makes the dialog modal and waits for the user to respond to it. dialogRun returns when any dialog button is clicked.

An example for using a modal dialog:

C code

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));
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);

You might do a non-modal MessageDialog as follows:

An example for a non-modal dialog:

C code

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_swapped (dialog, "response",
                          G_CALLBACK (gtk_widget_destroy),
                          dialog);

GtkMessageDialog as GtkBuildable

The GtkMessageDialog implementation of the GtkBuildable interface exposes the message area as an internal child with the name “message_area”.

Synopsis

Exported types

Methods

getImage

messageDialogGetImage Source #

Arguments

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

dialog: a MessageDialog

-> m Widget

Returns: the dialog’s image

Deprecated: (Since version 3.12)Use Dialog for dialogs with images

Gets the dialog’s image.

Since: 2.14

getMessageArea

messageDialogGetMessageArea Source #

Arguments

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

messageDialog: a MessageDialog

-> m Widget

Returns: A Box corresponding to the “message area” in the messageDialog.

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 dialogGetContentArea for the corresponding function in the parent Dialog.

Since: 2.22

setImage

messageDialogSetImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsMessageDialog a, IsWidget b) 
=> a

dialog: a MessageDialog

-> b

image: the image

-> m () 

Deprecated: (Since version 3.12)Use Dialog to create dialogs with images

Sets the dialog’s image to image.

Since: 2.10

setMarkup

messageDialogSetMarkup Source #

Arguments

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

messageDialog: a MessageDialog

-> Text

str: markup string (see [Pango markup format][PangoMarkupFormat])

-> m () 

Sets the text of the message dialog to be str, which is marked up with the [Pango text markup language][PangoMarkupFormat].

Since: 2.4

Properties

buttons

data MessageDialogButtonsPropertyInfo Source #

Instances

AttrInfo MessageDialogButtonsPropertyInfo Source # 
type AttrOrigin MessageDialogButtonsPropertyInfo Source # 
type AttrLabel MessageDialogButtonsPropertyInfo Source # 
type AttrGetType MessageDialogButtonsPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogButtonsPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogButtonsPropertyInfo Source # 
type AttrAllowedOps MessageDialogButtonsPropertyInfo Source # 

image

data MessageDialogImagePropertyInfo Source #

Instances

AttrInfo MessageDialogImagePropertyInfo Source # 
type AttrOrigin MessageDialogImagePropertyInfo Source # 
type AttrLabel MessageDialogImagePropertyInfo Source # 
type AttrGetType MessageDialogImagePropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogImagePropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogImagePropertyInfo Source # 
type AttrAllowedOps MessageDialogImagePropertyInfo Source # 

messageArea

data MessageDialogMessageAreaPropertyInfo Source #

Instances

AttrInfo MessageDialogMessageAreaPropertyInfo Source # 
type AttrOrigin MessageDialogMessageAreaPropertyInfo Source # 
type AttrLabel MessageDialogMessageAreaPropertyInfo Source # 
type AttrGetType MessageDialogMessageAreaPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogMessageAreaPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogMessageAreaPropertyInfo Source # 
type AttrAllowedOps MessageDialogMessageAreaPropertyInfo Source # 

messageType

data MessageDialogMessageTypePropertyInfo Source #

Instances

AttrInfo MessageDialogMessageTypePropertyInfo Source # 
type AttrOrigin MessageDialogMessageTypePropertyInfo Source # 
type AttrLabel MessageDialogMessageTypePropertyInfo Source # 
type AttrGetType MessageDialogMessageTypePropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogMessageTypePropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogMessageTypePropertyInfo Source # 
type AttrAllowedOps MessageDialogMessageTypePropertyInfo Source # 

secondaryText

data MessageDialogSecondaryTextPropertyInfo Source #

Instances

AttrInfo MessageDialogSecondaryTextPropertyInfo Source # 
type AttrOrigin MessageDialogSecondaryTextPropertyInfo Source # 
type AttrLabel MessageDialogSecondaryTextPropertyInfo Source # 
type AttrGetType MessageDialogSecondaryTextPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogSecondaryTextPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogSecondaryTextPropertyInfo Source # 
type AttrAllowedOps MessageDialogSecondaryTextPropertyInfo Source # 

secondaryUseMarkup

data MessageDialogSecondaryUseMarkupPropertyInfo Source #

Instances

AttrInfo MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrOrigin MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrLabel MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrGetType MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogSecondaryUseMarkupPropertyInfo Source # 
type AttrAllowedOps MessageDialogSecondaryUseMarkupPropertyInfo Source # 

text

data MessageDialogTextPropertyInfo Source #

Instances

AttrInfo MessageDialogTextPropertyInfo Source # 
type AttrOrigin MessageDialogTextPropertyInfo Source # 
type AttrLabel MessageDialogTextPropertyInfo Source # 
type AttrGetType MessageDialogTextPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogTextPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogTextPropertyInfo Source # 
type AttrAllowedOps MessageDialogTextPropertyInfo Source # 

useMarkup

data MessageDialogUseMarkupPropertyInfo Source #

Instances

AttrInfo MessageDialogUseMarkupPropertyInfo Source # 
type AttrOrigin MessageDialogUseMarkupPropertyInfo Source # 
type AttrLabel MessageDialogUseMarkupPropertyInfo Source # 
type AttrGetType MessageDialogUseMarkupPropertyInfo Source # 
type AttrBaseTypeConstraint MessageDialogUseMarkupPropertyInfo Source # 
type AttrSetTypeConstraint MessageDialogUseMarkupPropertyInfo Source # 
type AttrAllowedOps MessageDialogUseMarkupPropertyInfo Source #