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.Selectors.ColorButton

Contents

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

Description

A button to launch a color selection dialog

- Module available since Gtk+ version 2.4

Synopsis

- data ColorButton
- class ButtonClass o => ColorButtonClass o
- castToColorButton :: GObjectClass obj => obj -> ColorButton
- gTypeColorButton :: GType
- toColorButton :: ColorButtonClass o => o -> ColorButton
- colorButtonNew :: IO ColorButton
- colorButtonNewWithColor :: Color -> IO ColorButton
- colorButtonSetColor :: ColorButtonClass self => self -> Color -> IO ()
- colorButtonGetColor :: ColorButtonClass self => self -> IO Color
- colorButtonSetAlpha :: ColorButtonClass self => self -> Word16 -> IO ()
- colorButtonGetAlpha :: ColorButtonClass self => self -> IO Word16
- colorButtonSetUseAlpha :: ColorButtonClass self => self -> Bool -> IO ()
- colorButtonGetUseAlpha :: ColorButtonClass self => self -> IO Bool
- colorButtonSetTitle :: (ColorButtonClass self, GlibString string) => self -> string -> IO ()
- colorButtonGetTitle :: (ColorButtonClass self, GlibString string) => self -> IO string
- colorButtonUseAlpha :: ColorButtonClass self => Attr self Bool
- colorButtonTitle :: (ColorButtonClass self, GlibString string) => Attr self string
- colorButtonAlpha :: ColorButtonClass self => Attr self Word16
- onColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self)
- afterColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self)

# Detail

The `ColorButton` is a button which displays the currently selected color an allows to open a color selection dialog to change the color. It is suitable widget for selecting a color in a preference dialog.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----Bin
    | +----Button
    | +----ColorButton

# Types

data ColorButton Source #

#### Instances

Instances details

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

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: ColorButton -> ColorButton -> Ordering Source #

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

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

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

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

max :: ColorButton -> ColorButton -> ColorButton Source #

min :: ColorButton -> ColorButton -> ColorButton Source #

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

class ButtonClass o => ColorButtonClass o Source #

#### Instances

Instances details

ColorButtonClass ColorButton Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToColorButton :: GObjectClass obj => obj -> ColorButton Source #

gTypeColorButton :: GType Source #

toColorButton :: ColorButtonClass o => o -> ColorButton Source #

# Constructors

colorButtonNew :: IO ColorButton Source #

Creates a new color button. This returns a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.

colorButtonNewWithColor Source #

Arguments

:: Color | `color` - A `Color` to set the current color with.
-> IO ColorButton |

Creates a new color button.

# Methods

colorButtonSetColor Source #

Arguments

:: ColorButtonClass self |
=> self |
-> Color | `color` - A `Color` to set the current color with.
-> IO () |

Sets the current color to be `color`.

colorButtonGetColor :: ColorButtonClass self => self -> IO Color Source #

Returns the current color value.

colorButtonSetAlpha Source #

Arguments

:: ColorButtonClass self |
=> self |
-> Word16 | `alpha` - an integer between 0 and 65535.
-> IO () |

Sets the current opacity to be `alpha`.

colorButtonGetAlpha Source #

Arguments

:: ColorButtonClass self |
=> self |
-> IO Word16 | returns an integer between 0 and 65535.

Returns the current alpha value.

colorButtonSetUseAlpha Source #

Arguments

:: ColorButtonClass self |
=> self |
-> Bool | `useAlpha` - `True` if color button should use alpha channel, `False` if not.
-> IO () |

Sets whether or not the color button should use the alpha channel.

colorButtonGetUseAlpha Source #

Arguments

:: ColorButtonClass self |
=> self |
-> IO Bool | returns `True` if the color sample uses alpha channel, `False` if not.

Does the color selection dialog use the alpha channel?

colorButtonSetTitle Source #

Arguments

:: (ColorButtonClass self, GlibString string) |
=> self |
-> string | `title` - String containing new window title.
-> IO () |

Sets the title for the color selection dialog.

colorButtonGetTitle Source #

Arguments

:: (ColorButtonClass self, GlibString string) |
=> self |
-> IO string | returns An internal string, do not free the return value

Gets the title of the color selection dialog.

# Attributes

colorButtonUseAlpha :: ColorButtonClass self => Attr self Bool Source #

If this property is set to `True`, the color swatch on the button is rendered against a checkerboard background to show its opacity and the opacity slider is displayed in the color selection dialog.

Default value: `False`

colorButtonTitle :: (ColorButtonClass self, GlibString string) => Attr self string Source #

The title of the color selection dialog

Default value: "Pick a Color"

colorButtonAlpha :: ColorButtonClass self => Attr self Word16 Source #

The selected opacity value (0 fully transparent, 65535 fully opaque).

Allowed values: <= 65535

Default value: 65535

# Signals

onColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self) Source #

The `colorSet` signal is emitted when the user selects a color. When handling this signal, use `colorButtonGetColor` and `colorButtonGetAlpha` to find out which color was just selected.

afterColorSet :: ColorButtonClass self => self -> IO () -> IO (ConnectId self) Source #

The `colorSet` signal is emitted when the user selects a color. When handling this signal, use `colorButtonGetColor` and `colorButtonGetAlpha` to find out which color was just selected.