gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ColorDialogButton

Contents

- Exported types
- Methods
  - getDialog
  - getRgba
  - new
  - setDialog
  - setRgba
- Properties
  - dialog
  - rgba
- Signals
  - activate

Description

Opens a color chooser dialog to select a color.

<picture> <source srcset="color-button-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkColorDialogButton" src="color-button.png"> </picture>

It is suitable widget for selecting a color in a preference dialog.

# CSS nodes

    colorbutton
    ╰── button.color
        ╰── [content]

`GtkColorDialogButton` has a single CSS node with name colorbutton which contains a button node. To differentiate it from a plain `GtkButton`, it gets the .color style class.

Since: 4.10

Synopsis

- newtype ColorDialogButton = ColorDialogButton (ManagedPtr ColorDialogButton)
- class (GObject o, IsDescendantOf ColorDialogButton o) => IsColorDialogButton o
- toColorDialogButton :: (MonadIO m, IsColorDialogButton o) => o -> m ColorDialogButton
- colorDialogButtonGetDialog :: (HasCallStack, MonadIO m, IsColorDialogButton a) => a -> m (Maybe ColorDialog)
- colorDialogButtonGetRgba :: (HasCallStack, MonadIO m, IsColorDialogButton a) => a -> m RGBA
- colorDialogButtonNew :: (HasCallStack, MonadIO m, IsColorDialog a) => Maybe a -> m ColorDialogButton
- colorDialogButtonSetDialog :: (HasCallStack, MonadIO m, IsColorDialogButton a, IsColorDialog b) => a -> b -> m ()
- colorDialogButtonSetRgba :: (HasCallStack, MonadIO m, IsColorDialogButton a) => a -> RGBA -> m ()
- constructColorDialogButtonDialog :: (IsColorDialogButton o, MonadIO m, IsColorDialog a) => a -> m (GValueConstruct o)
- getColorDialogButtonDialog :: (MonadIO m, IsColorDialogButton o) => o -> m (Maybe ColorDialog)
- setColorDialogButtonDialog :: (MonadIO m, IsColorDialogButton o, IsColorDialog a) => o -> a -> m ()
- constructColorDialogButtonRgba :: (IsColorDialogButton o, MonadIO m) => RGBA -> m (GValueConstruct o)
- getColorDialogButtonRgba :: (MonadIO m, IsColorDialogButton o) => o -> m RGBA
- setColorDialogButtonRgba :: (MonadIO m, IsColorDialogButton o) => o -> RGBA -> m ()
- type ColorDialogButtonActivateCallback = IO ()
- afterColorDialogButtonActivate :: (IsColorDialogButton a, MonadIO m) => a -> ((?self :: a) => ColorDialogButtonActivateCallback) -> m SignalHandlerId
- onColorDialogButtonActivate :: (IsColorDialogButton a, MonadIO m) => a -> ((?self :: a) => ColorDialogButtonActivateCallback) -> m SignalHandlerId

# Exported types

newtype ColorDialogButton Source #

Memory-managed wrapper type.

Constructors

ColorDialogButton (ManagedPtr ColorDialogButton) |

#### Instances

Instances details

Eq ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton Methods (==) :: ColorDialogButton -> ColorDialogButton -> Bool Source # (/=) :: ColorDialogButton -> ColorDialogButton -> Bool Source #
GObject ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton
ManagedPtrNewtype ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton Methods toManagedPtr :: ColorDialogButton -> ManagedPtr ColorDialogButton Source #
TypedObject ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton Methods glibType :: IO GType Source #
HasParentTypes ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton
IsGValue (Maybe ColorDialogButton) Source # | Convert `ColorDialogButton` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.ColorDialogButton Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ColorDialogButton -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ColorDialogButton) Source #
type ParentTypes ColorDialogButton Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton type ParentTypes ColorDialogButton = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf ColorDialogButton o) => IsColorDialogButton o Source #

Type class for types which can be safely cast to `ColorDialogButton`, for instance with `toColorDialogButton`.

#### Instances

Instances details

(GObject o, IsDescendantOf ColorDialogButton o) => IsColorDialogButton o Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialogButton

toColorDialogButton :: (MonadIO m, IsColorDialogButton o) => o -> m ColorDialogButton Source #

Cast to `ColorDialogButton`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDialog, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRgba, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDialog, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setRgba, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## getDialog

colorDialogButtonGetDialog Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialogButton a) |
=> a | `self`: a `GtkColorDialogButton`
-> m (Maybe ColorDialog) | Returns: the `GtkColorDialog`

Returns the `GtkColorDialog` of `self`.

Since: 4.10

## getRgba

colorDialogButtonGetRgba Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialogButton a) |
=> a | `self`: a `GtkColorDialogButton`
-> m RGBA | Returns: the color

Returns the color of the button.

This function is what should be used to obtain the color that was chosen by the user. To get informed about changes, listen to "notifyrgba".

Since: 4.10

## new

colorDialogButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> Maybe a | `dialog`: the `GtkColorDialog` to use
-> m ColorDialogButton | Returns: the new `GtkColorDialogButton`

Creates a new `GtkColorDialogButton` with the given `GtkColorDialog`.

You can pass `NULL` to this function and set a `GtkColorDialog` later. The button will be insensitive until that happens.

Since: 4.10

## setDialog

colorDialogButtonSetDialog Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialogButton a, IsColorDialog b) |
=> a | `self`: a `GtkColorDialogButton`
-> b | `dialog`: the new `GtkColorDialog`
-> m () |

Sets a `GtkColorDialog` object to use for creating the color chooser dialog that is presented when the user clicks the button.

Since: 4.10

## setRgba

colorDialogButtonSetRgba Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialogButton a) |
=> a | `self`: a `GtkColorDialogButton`
-> RGBA | `color`: the new color
-> m () |

Sets the color of the button.

Since: 4.10

# Properties

## dialog

The `GtkColorDialog` that contains parameters for the color chooser dialog.

Since: 4.10

constructColorDialogButtonDialog :: (IsColorDialogButton o, MonadIO m, IsColorDialog a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`dialog`” property. This is rarely needed directly, but it is used by `new`.

getColorDialogButtonDialog :: (MonadIO m, IsColorDialogButton o) => o -> m (Maybe ColorDialog) Source #

Get the value of the “`dialog`” property. When overloading is enabled, this is equivalent to

    get colorDialogButton #dialog

setColorDialogButtonDialog :: (MonadIO m, IsColorDialogButton o, IsColorDialog a) => o -> a -> m () Source #

Set the value of the “`dialog`” property. When overloading is enabled, this is equivalent to

    set colorDialogButton [ #dialog := value ]

## rgba

The selected color.

This property can be set to give the button its initial color, and it will be updated to reflect the users choice in the color chooser dialog.

Listen to `notify::rgba` to get informed about changes to the buttons color.

Since: 4.10

constructColorDialogButtonRgba :: (IsColorDialogButton o, MonadIO m) => RGBA -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`rgba`” property. This is rarely needed directly, but it is used by `new`.

getColorDialogButtonRgba :: (MonadIO m, IsColorDialogButton o) => o -> m RGBA Source #

Get the value of the “`rgba`” property. When overloading is enabled, this is equivalent to

    get colorDialogButton #rgba

setColorDialogButtonRgba :: (MonadIO m, IsColorDialogButton o) => o -> RGBA -> m () Source #

Set the value of the “`rgba`” property. When overloading is enabled, this is equivalent to

    set colorDialogButton [ #rgba := value ]

# Signals

## activate

type ColorDialogButtonActivateCallback = IO () Source #

Emitted when the color dialog button is activated.

The `::activate` signal on `GtkColorDialogButton` is an action signal and emitting it causes the button to pop up its dialog.

Since: 4.14

afterColorDialogButtonActivate :: (IsColorDialogButton a, MonadIO m) => a -> ((?self :: a) => ColorDialogButtonActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after colorDialogButton #activate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onColorDialogButtonActivate :: (IsColorDialogButton a, MonadIO m) => a -> ((?self :: a) => ColorDialogButtonActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on colorDialogButton #activate callback