gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

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

Graphics.UI.Gtk.Buttons.ToggleButton

Contents

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

Description

Create buttons which retain their state

Synopsis

- data ToggleButton
- class ButtonClass o => ToggleButtonClass o
- castToToggleButton :: GObjectClass obj => obj -> ToggleButton
- gTypeToggleButton :: GType
- toToggleButton :: ToggleButtonClass o => o -> ToggleButton
- toggleButtonNew :: IO ToggleButton
- toggleButtonNewWithLabel :: GlibString string => string -> IO ToggleButton
- toggleButtonNewWithMnemonic :: GlibString string => string -> IO ToggleButton
- toggleButtonSetMode :: ToggleButtonClass self => self -> Bool -> IO ()
- toggleButtonGetMode :: ToggleButtonClass self => self -> IO Bool
- toggleButtonToggled :: ToggleButtonClass self => self -> IO ()
- toggleButtonGetActive :: ToggleButtonClass self => self -> IO Bool
- toggleButtonSetActive :: ToggleButtonClass self => self -> Bool -> IO ()
- toggleButtonGetInconsistent :: ToggleButtonClass self => self -> IO Bool
- toggleButtonSetInconsistent :: ToggleButtonClass self => self -> Bool -> IO ()
- toggleButtonActive :: ToggleButtonClass self => Attr self Bool
- toggleButtonInconsistent :: ToggleButtonClass self => Attr self Bool
- toggleButtonDrawIndicator :: ToggleButtonClass self => Attr self Bool
- toggleButtonMode :: ToggleButtonClass self => Attr self Bool
- toggled :: ToggleButtonClass self => Signal self (IO ())

# Detail

A `ToggleButton` is a `Button` which will remain 'pressed-in' when clicked. Clicking again will cause the toggle button to return to its normal state.

A toggle button is created by calling either `toggleButtonNew` or `toggleButtonNewWithLabel`. If using the former, it is advisable to pack a widget, (such as a `Label` and/or a `Pixmap`), into the toggle button's container. (See `Button` for more information).

The state of a `ToggleButton` can be set specifically using `toggleButtonSetActive`, and retrieved using `toggleButtonGetActive`.

To simply switch the state of a toggle button, use `toggleButtonToggled`.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Bin
    | +----Button
    | +----ToggleButton
    | +----CheckButton

# Types

data ToggleButton Source #

#### Instances

Instances details

Eq ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: ToggleButton -> ToggleButton -> Bool Source # (/=) :: ToggleButton -> ToggleButton -> Bool Source #
Ord ToggleButton Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: ToggleButton -> ToggleButton -> Ordering Source #

(<) :: ToggleButton -> ToggleButton -> Bool Source #

(<=) :: ToggleButton -> ToggleButton -> Bool Source #

(>) :: ToggleButton -> ToggleButton -> Bool Source #

(>=) :: ToggleButton -> ToggleButton -> Bool Source #

max :: ToggleButton -> ToggleButton -> ToggleButton Source #

min :: ToggleButton -> ToggleButton -> ToggleButton Source #

GObjectClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: ToggleButton -> GObject Source # unsafeCastGObject :: GObject -> ToggleButton Source #
BinClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ButtonClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ContainerClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToggleButtonClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ButtonClass o => ToggleButtonClass o Source #

#### Instances

Instances details

ToggleButtonClass CheckButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToggleButtonClass RadioButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types
ToggleButtonClass ToggleButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToToggleButton :: GObjectClass obj => obj -> ToggleButton Source #

gTypeToggleButton :: GType Source #

toToggleButton :: ToggleButtonClass o => o -> ToggleButton Source #

# Constructors

toggleButtonNew :: IO ToggleButton Source #

Creates a new toggle button. A widget should be packed into the button, as in `buttonNew`.

toggleButtonNewWithLabel Source #

Arguments

:: GlibString string |
=> string | `label` - a string containing the message to be placed in the toggle button.
-> IO ToggleButton |

Creates a new toggle button with a text label.

toggleButtonNewWithMnemonic Source #

Arguments

:: GlibString string |
=> string | `label` - the text of the button, with an underscore in front of the mnemonic character
-> IO ToggleButton |

Creates a new `ToggleButton` containing a label. The label will be created using `labelNewWithMnemonic`, so underscores in `label` indicate the mnemonic for the button.

# Methods

toggleButtonSetMode Source #

Arguments

:: ToggleButtonClass self |
=> self |
-> Bool | `drawIndicator` - if `True`, draw the button as a separate indicator and label; if `False`, draw the button like a normal button
-> IO () |

Sets whether the button is displayed as a separate indicator and label. You can call this function on a `CheckButton` or a `RadioButton` with `False` to make the button look like a normal button.

This function only affects instances of classes like `CheckButton` and `RadioButton` that derive from `ToggleButton`, not instances of `ToggleButton` itself.

toggleButtonGetMode Source #

Arguments

:: ToggleButtonClass self |
=> self |
-> IO Bool | returns `True` if the togglebutton is drawn as a separate indicator and label.

Retrieves whether the button is displayed as a separate indicator and label. See `toggleButtonSetMode`.

toggleButtonToggled :: ToggleButtonClass self => self -> IO () Source #

Emits the toggled signal on the `ToggleButton`. There is no good reason for an application ever to call this function.

toggleButtonGetActive :: ToggleButtonClass self => self -> IO Bool Source #

Queries a `ToggleButton` and returns its current state. Returns `True` if the toggle button is pressed in and `False` if it is raised.

toggleButtonSetActive Source #

Arguments

:: ToggleButtonClass self |
=> self |
-> Bool | `isActive` - `True` or `False`.
-> IO () |

Sets the status of the toggle button. Set to `True` if you want the `ToggleButton` to be 'pressed in', and `False` to raise it. This action causes the toggled signal to be emitted.

toggleButtonGetInconsistent Source #

Arguments

:: ToggleButtonClass self |
=> self |
-> IO Bool | returns `True` if the button is displayed as inconsistent, `False` otherwise

Gets the value set by `toggleButtonSetInconsistent`.

toggleButtonSetInconsistent Source #

Arguments

:: ToggleButtonClass self |
=> self |
-> Bool | `setting` - `True` if state is inconsistent
-> IO () |

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a toggle button, and the current values in that range are inconsistent, you may want to display the toggle in an "in between" state. This function turns on "in between" display. Normally you would turn off the inconsistent state again if the user toggles the toggle button. This has to be done manually, `toggleButtonSetInconsistent` only affects visual appearance, it doesn't affect the semantics of the button.

# Attributes

toggleButtonActive :: ToggleButtonClass self => Attr self Bool Source #

If the toggle button should be pressed in or not.

Default value: `False`

toggleButtonInconsistent :: ToggleButtonClass self => Attr self Bool Source #

If the toggle button is in an "in between" state.

Default value: `False`

toggleButtonDrawIndicator :: ToggleButtonClass self => Attr self Bool Source #

If the toggle part of the button is displayed.

Default value: `False`

toggleButtonMode :: ToggleButtonClass self => Attr self Bool Source #

'mode' property. See `toggleButtonGetMode` and `toggleButtonSetMode`

# Signals

toggled :: ToggleButtonClass self => Signal self (IO ()) Source #

Should be connected if you wish to perform an action whenever the `ToggleButton'`s state is changed.

# Deprecated