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

Contents

- Exported types
- Methods
  - new
- Properties
  - showEditor

Description

The `GtkColorChooserWidget` widget lets the user select a color.

By default, the chooser presents a predefined palette of colors, plus a small number of settable custom colors. It is also possible to select a different color with the single-color editor.

To enter the single-color editing mode, use the context menu of any color of the palette, or use the '+' button to add a new custom color.

The chooser automatically remembers the last selection, as well as custom colors.

To create a `GtkColorChooserWidget`, use `colorChooserWidgetNew`.

To change the initially selected color, use `colorChooserSetRgba`. To get the selected color use `colorChooserGetRgba`.

The `GtkColorChooserWidget` is used in the `ColorChooserDialog` to provide a dialog for selecting colors.

# Actions

`GtkColorChooserWidget` defines a set of built-in actions:

- `color.customize` activates the color editor for the given color.
- `color.select` emits the ColorChooser::colorActivated signal for the given color.

# CSS names

`GtkColorChooserWidget` has a single CSS node with name colorchooser.

Synopsis

- newtype ColorChooserWidget = ColorChooserWidget (ManagedPtr ColorChooserWidget)
- class (GObject o, IsDescendantOf ColorChooserWidget o) => IsColorChooserWidget o
- toColorChooserWidget :: (MonadIO m, IsColorChooserWidget o) => o -> m ColorChooserWidget
- colorChooserWidgetNew :: (HasCallStack, MonadIO m) => m ColorChooserWidget
- constructColorChooserWidgetShowEditor :: (IsColorChooserWidget o, MonadIO m) => Bool -> m (GValueConstruct o)
- getColorChooserWidgetShowEditor :: (MonadIO m, IsColorChooserWidget o) => o -> m Bool
- setColorChooserWidgetShowEditor :: (MonadIO m, IsColorChooserWidget o) => o -> Bool -> m ()

# Exported types

newtype ColorChooserWidget Source #

Memory-managed wrapper type.

Constructors

ColorChooserWidget (ManagedPtr ColorChooserWidget) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf ColorChooserWidget o) => IsColorChooserWidget o Source #

Type class for types which can be safely cast to `ColorChooserWidget`, for instance with `toColorChooserWidget`.

#### Instances

Instances details

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

toColorChooserWidget :: (MonadIO m, IsColorChooserWidget o) => o -> m ColorChooserWidget Source #

Cast to `ColorChooserWidget`, 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, addPalette, 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, 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, getUseAlpha, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, 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, setUseAlpha, setValign, setVexpand, setVexpandSet, setVisible.

## new

colorChooserWidgetNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m ColorChooserWidget | Returns: a new `GtkColorChooserWidget`

Deprecated: (Since version 4.10)

Creates a new `GtkColorChooserWidget`.

# Properties

## showEditor

`True` when the color chooser is showing the single-color editor.

It can be set to switch the color chooser into single-color editing mode.

constructColorChooserWidgetShowEditor :: (IsColorChooserWidget o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getColorChooserWidgetShowEditor :: (MonadIO m, IsColorChooserWidget o) => o -> m Bool Source #

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

    get colorChooserWidget #showEditor

setColorChooserWidgetShowEditor :: (MonadIO m, IsColorChooserWidget o) => o -> Bool -> m () Source #

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

    set colorChooserWidget [ #showEditor := value ]