Name

Dialog —

A dialog is a smaller window that is used to ask the user for input.

Synopsis

type
        IconSize
data
        ResponseId
type
        XID
dialogNew:: IO Dialog
dialogAddActionWidget:: (DialogClass dc, WidgetClass w) => dc -> w -> ResponseId -> IO ()
dialogAddButton:: DialogClass dc => dc -> String -> ResponseId -> IO Button
dialogGetActionArea:: DialogClass dc => dc -> IO HBox
dialogGetHasSeparator:: DialogClass dc => dc -> IO Bool
dialogGetUpper:: DialogClass dc => dc -> IO VBox
dialogResponse:: DialogClass dc => dc -> ResponseId -> IO ()
dialogRun:: DialogClass dc => dc -> IO ResponseId
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)

Datatypes

type IconSize

IconSizeInt

data ResponseId

Some constructors that can be used as response numbers for dialogs.

data ResponseId =ResponseAccept
| ResponseApply
| ResponseCancel
| ResponseClose
| ResponseDeleteEvent
| ResponseHelp
| ResponseNo
| ResponseNone
| ResponseOk
| ResponseReject
| ResponseUser Int
| ResponseYes

type XID

XIDCUInt

Constructors

dialogNew

Create a new Dialog.

dialogNew

Methods

dialogAddActionWidget

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

dialogAddActionWidget:: dc:: w:: ResponseId:: IO ()
dcchildresId

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.

dialogAddButton

Add a button with a label to the action area.

dialogAddButton:: dc:: String:: ResponseId:: IO Button
dcbuttonresId

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.

dialogGetActionArea

Extract the action area of a dialog box.

dialogGetActionArea:: dc:: IO HBox
dc

This is useful to add some special widgets that cannot be added with dialogAddActionWidget.

dialogGetHasSeparator

Query if the dialog has a visible horizontal separator.

dialogGetHasSeparator:: dc:: IO Bool
dc

dialogGetUpper

Get the upper part of a dialog.

dialogGetUpper:: dc:: IO VBox
dc

The upper part of a dialog window consists of a VBox. Add the required widgets into this box.

dialogResponse

Emit the response signal on the dialog.

dialogResponse:: dc:: ResponseId:: IO ()
dcresId

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.

dialogRun

Run the dialog by entering a new main loop.

dialogRun:: dc:: IO ResponseId
dc

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.

dialogSetDefaultResponse

Set the default widget that is to be activated if the user pressed enter. The object is specified by the ResponseId.

dialogSetDefaultResponse:: dc:: ResponseId:: IO ()
dcresId

dialogSetHasSeparator

Set the visibility of the horizontal separator.

dialogSetHasSeparator:: dc:: Bool:: IO ()
dcset

dialogSetResponseSensitive

Set widgets in the action are to be sensitive or not.

dialogSetResponseSensitive:: dc:: ResponseId:: Bool:: IO ()
dcresIdsensitive

Signals

onResponse

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).

onResponse:: dc:: (ResponseId -> IO ()):: IO (ConnectId dc)
diaact