Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The GtkColorButton
allows to open a color chooser dialog to change
the color.
It is suitable widget for selecting a color in a preference dialog.
CSS nodes
colorbutton ╰── button.color ╰── [content]
GtkColorButton
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.
Synopsis
- newtype ColorButton = ColorButton (ManagedPtr ColorButton)
- class (GObject o, IsDescendantOf ColorButton o) => IsColorButton o
- toColorButton :: (MonadIO m, IsColorButton o) => o -> m ColorButton
- colorButtonGetModal :: (HasCallStack, MonadIO m, IsColorButton a) => a -> m Bool
- colorButtonGetTitle :: (HasCallStack, MonadIO m, IsColorButton a) => a -> m Text
- colorButtonNew :: (HasCallStack, MonadIO m) => m ColorButton
- colorButtonNewWithRgba :: (HasCallStack, MonadIO m) => RGBA -> m ColorButton
- colorButtonSetModal :: (HasCallStack, MonadIO m, IsColorButton a) => a -> Bool -> m ()
- colorButtonSetTitle :: (HasCallStack, MonadIO m, IsColorButton a) => a -> Text -> m ()
- constructColorButtonModal :: (IsColorButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getColorButtonModal :: (MonadIO m, IsColorButton o) => o -> m Bool
- setColorButtonModal :: (MonadIO m, IsColorButton o) => o -> Bool -> m ()
- constructColorButtonShowEditor :: (IsColorButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getColorButtonShowEditor :: (MonadIO m, IsColorButton o) => o -> m Bool
- setColorButtonShowEditor :: (MonadIO m, IsColorButton o) => o -> Bool -> m ()
- constructColorButtonTitle :: (IsColorButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getColorButtonTitle :: (MonadIO m, IsColorButton o) => o -> m Text
- setColorButtonTitle :: (MonadIO m, IsColorButton o) => o -> Text -> m ()
- type ColorButtonActivateCallback = IO ()
- afterColorButtonActivate :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonActivateCallback) -> m SignalHandlerId
- onColorButtonActivate :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonActivateCallback) -> m SignalHandlerId
- type ColorButtonColorSetCallback = IO ()
- afterColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonColorSetCallback) -> m SignalHandlerId
- onColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonColorSetCallback) -> m SignalHandlerId
Exported types
newtype ColorButton Source #
Memory-managed wrapper type.
ColorButton (ManagedPtr ColorButton) |
Instances
Eq ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton (==) :: ColorButton -> ColorButton -> Bool # (/=) :: ColorButton -> ColorButton -> Bool # | |
GObject ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton | |
ManagedPtrNewtype ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton toManagedPtr :: ColorButton -> ManagedPtr ColorButton | |
TypedObject ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton | |
HasParentTypes ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton | |
IsGValue (Maybe ColorButton) Source # | Convert |
Defined in GI.Gtk.Objects.ColorButton gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ColorButton -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ColorButton) | |
type ParentTypes ColorButton Source # | |
Defined in GI.Gtk.Objects.ColorButton type ParentTypes ColorButton = '[Widget, Object, Accessible, Buildable, ColorChooser, ConstraintTarget] |
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
(GObject o, IsDescendantOf ColorButton o) => IsColorButton o Source # | |
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
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addPalette, addTickCallback, allocate, 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, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, 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, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getModal, 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, getTitle, 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, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setModal, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setRgba, setSensitive, setSizeRequest, setStateFlags, setTitle, setTooltipMarkup, setTooltipText, setUseAlpha, setValign, setVexpand, setVexpandSet, setVisible.
getModal
:: (HasCallStack, MonadIO m, IsColorButton a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 4.10)Use ColorDialogButton
instead
Gets whether the dialog is modal.
getTitle
:: (HasCallStack, MonadIO m, IsColorButton a) | |
=> a |
|
-> m Text | Returns: An internal string, do not free the return value |
Deprecated: (Since version 4.10)Use ColorDialogButton
instead
Gets the title of the color chooser dialog.
new
:: (HasCallStack, MonadIO m) | |
=> m ColorButton | Returns: a new color button |
Deprecated: (Since version 4.10)Use ColorDialogButton
instead
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 chooser 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 #
:: (HasCallStack, MonadIO m) | |
=> RGBA |
|
-> m ColorButton | Returns: a new color button |
Creates a new color button showing the given color.
setModal
:: (HasCallStack, MonadIO m, IsColorButton a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 4.10)Use ColorDialogButton
instead
Sets whether the dialog should be modal.
setTitle
:: (HasCallStack, MonadIO m, IsColorButton a) | |
=> a |
|
-> Text |
|
-> m () |
Deprecated: (Since version 4.10)Use ColorDialogButton
instead
Sets the title for the color chooser dialog.
Properties
modal
Whether the color chooser dialog should be modal.
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
Whether the color chooser should open in editor mode.
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 chooser 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
activate
type ColorButtonActivateCallback = IO () Source #
Emitted to when the color button is activated.
The ::activate
signal on GtkMenuButton
is an action signal and
emitting it causes the button to pop up its dialog.
Since: 4.4
afterColorButtonActivate :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonActivateCallback) -> 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
colorButton #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.
onColorButtonActivate :: (IsColorButton a, MonadIO m) => a -> ((?self :: a) => ColorButtonActivateCallback) -> 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
colorButton #activate callback
colorSet
type ColorButtonColorSetCallback = IO () Source #
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 notifyrgba signal.
afterColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ((?self :: 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
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.
onColorButtonColorSet :: (IsColorButton a, MonadIO m) => a -> ((?self :: 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