Gtk2HsContentsIndex
Graphics.UI.Gtk.Windows.Dialog
Description
A dialog is a smaller window that is used to ask the user for input.
Synopsis
data Dialog
class WindowClass o => DialogClass o
castToDialog :: GObjectClass obj => obj -> Dialog
dialogNew :: IO Dialog
dialogGetUpper :: DialogClass dc => dc -> IO VBox
dialogGetActionArea :: DialogClass dc => dc -> IO HBox
dialogRun :: DialogClass dc => dc -> IO ResponseId
dialogResponse :: DialogClass dc => dc -> ResponseId -> IO ()
data ResponseId
= ResponseNone
| ResponseReject
| ResponseAccept
| ResponseDeleteEvent
| ResponseOk
| ResponseCancel
| ResponseClose
| ResponseYes
| ResponseNo
| ResponseApply
| ResponseHelp
| ResponseUser Int
dialogAddButton :: DialogClass dc => dc -> String -> ResponseId -> IO Button
dialogAddActionWidget :: (DialogClass dc, WidgetClass w) => dc -> w -> ResponseId -> IO ()
dialogGetHasSeparator :: DialogClass dc => dc -> IO Bool
dialogSetDefaultResponse :: DialogClass dc => dc -> ResponseId -> IO ()
dialogSetHasSeparator :: DialogClass dc => dc -> Bool -> IO ()
dialogSetResponseSensitive :: DialogClass dc => dc -> ResponseId -> Bool -> IO ()
onResponse :: DialogClass dc => dc -> (ResponseId -> IO ()) -> IO (ConnectId dc)
afterResponse :: DialogClass dc => dc -> (ResponseId -> IO ()) -> IO (ConnectId dc)
Documentation
data Dialog
Instances
DialogClass Dialog
WindowClass Dialog
BinClass Dialog
ContainerClass Dialog
WidgetClass Dialog
ObjectClass Dialog
GObjectClass Dialog
class WindowClass o => DialogClass o
Instances
DialogClass Dialog
DialogClass ColorSelectionDialog
DialogClass FileSelection
DialogClass FileChooserDialog
DialogClass FontSelectionDialog
DialogClass InputDialog
DialogClass MessageDialog
castToDialog :: GObjectClass obj => obj -> Dialog
dialogNew :: IO Dialog
Create a new Dialog.
dialogGetUpper :: DialogClass dc => dc -> IO VBox

Get the upper part of a dialog.

  • The upper part of a dialog window consists of a VBox. Add the required widgets into this box.
dialogGetActionArea :: DialogClass dc => dc -> IO HBox

Extract the action area of a dialog box.

  • This is useful to add some special widgets that cannot be added with dialogAddActionWidget.
dialogRun :: DialogClass dc => dc -> IO ResponseId

Run the dialog by entering a new main loop.

  • The dialog is run until it is either forced to quit (-1 will be returned) or until the user clicks a button (or other widget) in the action area that makes the dialog emit the response signal (the response id of the pressed button will be returned).
  • To force a dialog to quit, call dialogResponse on it.
  • If this function returns the dialog still needs to be destroyed.
dialogResponse :: DialogClass dc => dc -> ResponseId -> IO ()

Emit the response signal on the dialog.

  • This function can be used to add a custom widget to the action area that should close the dialog when activated or to close the dialog otherwise.
data ResponseId
Some constructors that can be used as response numbers for dialogs.
Constructors
ResponseNoneGTK returns this if a response widget has no response_id, or if the dialog gets programmatically hidden or destroyed.
ResponseRejectGTK won't return these unless you pass them in as the response for an action widget. They are for your convenience.
ResponseAccept(as above)
ResponseDeleteEventIf the dialog is deleted.
ResponseOk

"Ok" was pressed.

  • This value is returned from the "Ok" stock dialog button.
ResponseCancel

"Cancel" was pressed.

  • These value is returned from the "Cancel" stock dialog button.
ResponseClose

"Close" was pressed.

  • This value is returned from the "Close" stock dialog button.
ResponseYes

"Yes" was pressed.

  • This value is returned from the "Yes" stock dialog button.
ResponseNo

"No" was pressed.

  • This value is returned from the "No" stock dialog button.
ResponseApply

"Apply" was pressed.

  • This value is returned from the "Apply" stock dialog button.
ResponseHelp

"Help" was pressed.

  • This value is returned from the "Help" stock dialog button.
ResponseUser Int

A user-defined response

  • This value is returned from a user defined button
Instances
Show ResponseId
dialogAddButton :: DialogClass dc => dc -> String -> ResponseId -> IO Button

Add a button with a label to the action area.

  • The text may as well refer to a stock object. If such an object exists it is taken as widget.
  • The function returns the Button that resulted from the call.
dialogAddActionWidget :: (DialogClass dc, WidgetClass w) => dc -> w -> ResponseId -> IO ()

Add a widget to the action area. If the widget is put into the activated state resId will be transmitted by the response signal.

  • A widget that cannot be activated and therefore has to emit the response signal manually must be added by packing it into the action area.
dialogGetHasSeparator :: DialogClass dc => dc -> IO Bool
Query if the dialog has a visible horizontal separator.
dialogSetDefaultResponse :: DialogClass dc => dc -> ResponseId -> IO ()
Set the default widget that is to be activated if the user pressed enter. The object is specified by the ResponseId.
dialogSetHasSeparator :: DialogClass dc => dc -> Bool -> IO ()
Set the visibility of the horizontal separator.
dialogSetResponseSensitive :: DialogClass dc => dc -> ResponseId -> Bool -> IO ()
Set widgets in the action are to be sensitive or not.
onResponse :: DialogClass dc => dc -> (ResponseId -> IO ()) -> IO (ConnectId dc)
This signal is sent when a widget in the action area was activated, the dialog is received a destory event or the user calls dialogResponse. It is usually used to terminate the dialog (by dialogRun for example).
afterResponse :: DialogClass dc => dc -> (ResponseId -> IO ()) -> IO (ConnectId dc)
Produced by Haddock version 0.6