Graphics.UI.Gtk.Windows.MessageDialog

gtk-0.12.4: Binding to the Gtk+ graphical user interface library.

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net
Safe Haskell | None

Graphics.UI.Gtk.Windows.MessageDialog

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes

Description

A convenient message window

Synopsis

- data MessageDialog
- class DialogClass o => MessageDialogClass o
- castToMessageDialog :: GObjectClass obj => obj -> MessageDialog
- gTypeMessageDialog :: GType
- toMessageDialog :: MessageDialogClass o => o -> MessageDialog
- data MessageType
  - = MessageInfo
  - | MessageWarning
  - | MessageQuestion
  - | MessageError
  - | MessageOther
- data ButtonsType
  - = ButtonsNone
  - | ButtonsOk
  - | ButtonsClose
  - | ButtonsCancel
  - | ButtonsYesNo
  - | ButtonsOkCancel
- data DialogFlags
  - = DialogModal
  - | DialogDestroyWithParent
  - | DialogNoSeparator
- messageDialogNew :: Maybe Window -> [DialogFlags] -> MessageType -> ButtonsType -> String -> IO MessageDialog
- messageDialogNewWithMarkup :: Maybe Window -> [DialogFlags] -> MessageType -> ButtonsType -> Markup -> IO MessageDialog
- messageDialogSetMarkup :: MessageDialogClass self => self -> Markup -> IO ()
- messageDialogSetImage :: (MessageDialogClass self, WidgetClass image) => self -> image -> IO ()
- messageDialogSetSecondaryMarkup :: MessageDialogClass self => self -> String -> IO ()
- messageDialogSetSecondaryText :: MessageDialogClass self => self -> String -> IO ()
- messageDialogMessageType :: MessageDialogClass self => Attr self MessageType
- messageDialogText :: MessageDialogClass self => Attr self (Maybe String)
- messageDialogUseMarkup :: MessageDialogClass self => Attr self Bool
- messageDialogSecondaryText :: MessageDialogClass self => Attr self (Maybe String)
- messageDialogSecondaryUseMarkup :: MessageDialogClass self => Attr self Bool
- messageDialogImage :: (MessageDialogClass self, WidgetClass widget) => ReadWriteAttr self Widget widget
- messageDialogButtons :: MessageDialogClass self => WriteAttr self ButtonsType
- messageDialogMessageArea :: MessageDialogClass self => ReadAttr self VBox

# Detail

`MessageDialog` presents a dialog with an image representing the type of message (Error, Question, etc.) alongside 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.

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

# Class Hierarchy

     | GObject
     | +----Object
     | +----Widget
     | +----Container
     | +----Bin
     | +----Window
     | +----Dialog
     | +----MessageDialog

# Types

data MessageDialog

Instances

Eq MessageDialog |
Ord MessageDialog |
GObjectClass MessageDialog |
MessageDialogClass MessageDialog |
DialogClass MessageDialog |
WindowClass MessageDialog |
BinClass MessageDialog |
ContainerClass MessageDialog |
WidgetClass MessageDialog |
ObjectClass MessageDialog |

class DialogClass o => MessageDialogClass o

Instances

MessageDialogClass MessageDialog |

castToMessageDialog :: GObjectClass obj => obj -> MessageDialog

gTypeMessageDialog :: GType

toMessageDialog :: MessageDialogClass o => o -> MessageDialog

data MessageType

Constructors

MessageInfo |
MessageWarning |
MessageQuestion |
MessageError |
MessageOther |

Instances

Enum MessageType |
Eq MessageType |
Show MessageType |

data ButtonsType

Specify what buttons this dialog should show.

- Prebuilt sets of buttons for the dialog. If none of these choices are appropriate, simply use `ButtonsNone` then call `dialogAddButtons`.

Constructors

ButtonsNone |
ButtonsOk |
ButtonsClose |
ButtonsCancel |
ButtonsYesNo |
ButtonsOkCancel |

Instances

Enum ButtonsType |
Eq ButtonsType |
Show ButtonsType |

data DialogFlags

Flags used to influence dialog construction.

- Marking a dialog as model will call `widgetSetModal` on the dialog window, the `DialogDestroyWithParent` will call `windowSetDestroyWithParent` on the dialog window. Note that in case the dialog is simply destroyed, no response signal is ever emitted. Finally, `DialogNoSeparator` omits the separator between the action area and the dialog content which is preferable for very simple messages, i.e. those that only contain one button.

Constructors

DialogModal |
DialogDestroyWithParent |
DialogNoSeparator |

Instances

Bounded DialogFlags |
Enum DialogFlags |
Eq DialogFlags |
Show DialogFlags |
Flags DialogFlags |

# Constructors

messageDialogNew

Arguments

:: Maybe Window | Transient parent of the dialog (or none)
-> [DialogFlags] |
-> MessageType |
-> ButtonsType |
-> String | The text of the message
-> IO MessageDialog |

Create a new message dialog, which is a simple dialog with an icon indicating the dialog type (error, warning, etc.) and some text the user may want to see. When the user clicks a button a "response" signal is emitted with response IDs from `ResponseType`. See `Dialog` for more details.

messageDialogNewWithMarkup

Arguments

:: Maybe Window | Transient parent of the dialog (or none)
-> [DialogFlags] |
-> MessageType |
-> ButtonsType |
-> Markup | The text of the message
-> IO MessageDialog |

Creates a new message dialog, which is a simple dialog with an icon indicating the dialog type (error, warning, etc.) and some text which is marked up with the Pango text markup language. When the user clicks a button a "response" signal is emitted with response IDs from `ResponseType`. See `Dialog` and `PangoMarkup` for more details.

- Available since Gtk+ version 2.4

# Methods

messageDialogSetMarkup

Arguments

:: MessageDialogClass self |
=> self |
-> Markup | `str` - markup string (see Pango markup format)
-> IO () |

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

- Available since Gtk+ version 2.4

messageDialogSetImage

Arguments

:: (MessageDialogClass self, WidgetClass image) |
=> self |
-> image | `image` - the image
-> IO () |

Sets the dialog's image to `image`.

- Available since Gtk+ version 2.10

messageDialogSetSecondaryMarkup

Arguments

:: MessageDialogClass self |
=> self |
-> String | `str` - markup string (see Pango markup format)
-> IO () |

messageDialogSetSecondaryText

Arguments

:: MessageDialogClass self |
=> self |
-> String | `str` - text to be shown as second line
-> IO () |

# Attributes

messageDialogMessageType :: MessageDialogClass self => Attr self MessageType

The type of message.

Default value: `MessageInfo`

messageDialogText :: MessageDialogClass self => Attr self (Maybe String)

The primary text of the message dialog. If the dialog has a secondary text, this will appear as the title.

Default value: `Nothing`

- Available since Gtk+ version 2.10

messageDialogUseMarkup :: MessageDialogClass self => Attr self Bool

Interpret the string `messageDialogText` as markup.

Default value: `False`

- Available since Gtk+ version 2.10

messageDialogSecondaryText :: MessageDialogClass self => Attr self (Maybe String)

The secondary text of the message dialog.

Default value: `Nothing`

- Available since Gtk+ version 2.10

messageDialogSecondaryUseMarkup :: MessageDialogClass self => Attr self Bool

Default value: `False`

- Available since Gtk+ version 2.10

messageDialogImage :: (MessageDialogClass self, WidgetClass widget) => ReadWriteAttr self Widget widget

The image for this dialog.

- Available since Gtk+ version 2.10

messageDialogButtons :: MessageDialogClass self => WriteAttr self ButtonsType

The buttons shown in the message dialog.

Default value: `ButtonsNone`

messageDialogMessageArea :: MessageDialogClass self => ReadAttr self VBox

The `VBox` that corresponds to the message area of this dialog.

- Available since Gtk+ version 2.22