gi-gtk-4.0.4: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ColorButton

Description

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

CSS nodes

plain code

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

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

Synopsis

Exported types

newtype ColorButton Source #

Memory-managed wrapper type.

Constructors

ColorButton (ManagedPtr ColorButton) 

Instances

Instances details
Eq ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

GObject ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

ManagedPtrNewtype ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

Methods

toManagedPtr :: ColorButton -> ManagedPtr ColorButton

TypedObject ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

Methods

glibType :: IO GType

HasParentTypes ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

IsGValue (Maybe ColorButton) Source #

Convert ColorButton to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ColorButton

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ColorButton -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ColorButton)

type ParentTypes ColorButton Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

class (GObject o, IsDescendantOf ColorButton o) => IsColorButton o Source #

Type class for types which can be safely cast to ColorButton, for instance with toColorButton.

Instances

Instances details
(GObject o, IsDescendantOf ColorButton o) => IsColorButton o Source # 
Instance details

Defined in GI.Gtk.Objects.ColorButton

toColorButton :: (MonadIO m, IsColorButton o) => o -> m ColorButton Source #

Cast to ColorButton, 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, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, 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, updateProperty, updateRelation, updateState, watchClosure.

Getters

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

Setters

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

getModal

colorButtonGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorButton a) 
=> a

button: a ColorButton

-> m Bool

Returns: True if the dialog is modal

Gets whether the dialog is modal.

getTitle

colorButtonGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorButton a) 
=> a

button: a ColorButton

-> m Text

Returns: An internal string, do not free the return value

Gets the title of the color selection dialog.

new

colorButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m ColorButton

Returns: a new color button

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.

newWithRgba

colorButtonNewWithRgba Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> RGBA

rgba: A RGBA to set the current color with

-> m ColorButton

Returns: a new color button

Creates a new color button.

setModal

colorButtonSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorButton a) 
=> a

button: a ColorButton

-> Bool

modal: True to make the dialog modal

-> m () 

Sets whether the dialog should be modal.

setTitle

colorButtonSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorButton a) 
=> a

button: a ColorButton

-> Text

title: String containing new window title

-> m () 

Sets the title for the color selection dialog.

Properties

modal

No description available in the introspection data.

constructColorButtonModal :: (IsColorButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getColorButtonModal :: (MonadIO m, IsColorButton o) => o -> m Bool Source #

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

get colorButton #modal

setColorButtonModal :: (MonadIO m, IsColorButton o) => o -> Bool -> m () Source #

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

set colorButton [ #modal := value ]

showEditor

Set this property to True to skip the palette in the dialog and go directly to the color editor.

This property should be used in cases where the palette in the editor would be redundant, such as when the color button is already part of a palette.

constructColorButtonShowEditor :: (IsColorButton 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.

getColorButtonShowEditor :: (MonadIO m, IsColorButton o) => o -> m Bool Source #

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

get colorButton #showEditor

setColorButtonShowEditor :: (MonadIO m, IsColorButton o) => o -> Bool -> m () Source #

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

set colorButton [ #showEditor := value ]

title

The title of the color selection dialog

constructColorButtonTitle :: (IsColorButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getColorButtonTitle :: (MonadIO m, IsColorButton o) => o -> m Text Source #

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

get colorButton #title

setColorButtonTitle :: (MonadIO m, IsColorButton o) => o -> Text -> m () Source #

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

set colorButton [ #title := value ]

Signals

colorSet

type C_ColorButtonColorSetCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ColorButtonColorSetCallback = IO () Source #

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

Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify[color](#g:signal:color) signal.

afterColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ColorButtonColorSetCallback -> m SignalHandlerId Source #

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

after colorButton #colorSet callback

onColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ColorButtonColorSetCallback -> m SignalHandlerId Source #

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

on colorButton #colorSet callback