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 |
A GtkColorDialog
object collects the arguments that
are needed to present a color chooser dialog to the
user, such as a title for the dialog and whether it
should be modal.
The dialog is shown with the colorDialogChooseRgba
function. This API follows the GIO async pattern, and the
result can be obtained by calling
colorDialogChooseRgbaFinish
.
See ColorDialogButton
for a convenient control
that uses GtkColorDialog
and presents the results.
Since: 4.10
Synopsis
- newtype ColorDialog = ColorDialog (ManagedPtr ColorDialog)
- class (GObject o, IsDescendantOf ColorDialog o) => IsColorDialog o
- toColorDialog :: (MonadIO m, IsColorDialog o) => o -> m ColorDialog
- colorDialogChooseRgba :: (HasCallStack, MonadIO m, IsColorDialog a, IsWindow b, IsCancellable c) => a -> Maybe b -> Maybe RGBA -> Maybe c -> Maybe AsyncReadyCallback -> m ()
- colorDialogChooseRgbaFinish :: (HasCallStack, MonadIO m, IsColorDialog a, IsAsyncResult b) => a -> b -> m (Maybe RGBA)
- colorDialogGetModal :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> m Bool
- colorDialogGetTitle :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> m Text
- colorDialogGetWithAlpha :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> m Bool
- colorDialogNew :: (HasCallStack, MonadIO m) => m ColorDialog
- colorDialogSetModal :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> Bool -> m ()
- colorDialogSetTitle :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> Text -> m ()
- colorDialogSetWithAlpha :: (HasCallStack, MonadIO m, IsColorDialog a) => a -> Bool -> m ()
- constructColorDialogModal :: (IsColorDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getColorDialogModal :: (MonadIO m, IsColorDialog o) => o -> m Bool
- setColorDialogModal :: (MonadIO m, IsColorDialog o) => o -> Bool -> m ()
- constructColorDialogTitle :: (IsColorDialog o, MonadIO m) => Text -> m (GValueConstruct o)
- getColorDialogTitle :: (MonadIO m, IsColorDialog o) => o -> m Text
- setColorDialogTitle :: (MonadIO m, IsColorDialog o) => o -> Text -> m ()
- constructColorDialogWithAlpha :: (IsColorDialog o, MonadIO m) => Bool -> m (GValueConstruct o)
- getColorDialogWithAlpha :: (MonadIO m, IsColorDialog o) => o -> m Bool
- setColorDialogWithAlpha :: (MonadIO m, IsColorDialog o) => o -> Bool -> m ()
Exported types
newtype ColorDialog Source #
Memory-managed wrapper type.
ColorDialog (ManagedPtr ColorDialog) |
Instances
Eq ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog (==) :: ColorDialog -> ColorDialog -> Bool # (/=) :: ColorDialog -> ColorDialog -> Bool # | |
GObject ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog | |
ManagedPtrNewtype ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog toManagedPtr :: ColorDialog -> ManagedPtr ColorDialog | |
TypedObject ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog | |
HasParentTypes ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog | |
IsGValue (Maybe ColorDialog) Source # | Convert |
Defined in GI.Gtk.Objects.ColorDialog gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe ColorDialog -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe ColorDialog) | |
type ParentTypes ColorDialog Source # | |
Defined in GI.Gtk.Objects.ColorDialog type ParentTypes ColorDialog = '[Object] |
class (GObject o, IsDescendantOf ColorDialog o) => IsColorDialog o Source #
Type class for types which can be safely cast to ColorDialog
, for instance with toColorDialog
.
Instances
(GObject o, IsDescendantOf ColorDialog o) => IsColorDialog o Source # | |
Defined in GI.Gtk.Objects.ColorDialog |
toColorDialog :: (MonadIO m, IsColorDialog o) => o -> m ColorDialog Source #
Cast to ColorDialog
, 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
bindProperty, bindPropertyFull, chooseRgba, chooseRgbaFinish, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getModal, getProperty, getQdata, getTitle, getWithAlpha.
Setters
setData, setDataFull, setModal, setProperty, setTitle, setWithAlpha.
chooseRgba
colorDialogChooseRgba Source #
:: (HasCallStack, MonadIO m, IsColorDialog a, IsWindow b, IsCancellable c) | |
=> a |
|
-> Maybe b |
|
-> Maybe RGBA |
|
-> Maybe c |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
This function initiates a color choice operation by presenting a color chooser dialog to the user.
The callback
will be called when the dialog is dismissed.
It should call colorDialogChooseRgbaFinish
to obtain the result.
Since: 4.10
chooseRgbaFinish
colorDialogChooseRgbaFinish Source #
:: (HasCallStack, MonadIO m, IsColorDialog a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m (Maybe RGBA) | Returns: the selected color, or
|
Finishes the colorDialogChooseRgba
call and
returns the resulting color.
Since: 4.10
getModal
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.
Since: 4.10
getTitle
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> m Text | Returns: the title |
Returns the title that will be shown on the color chooser dialog.
Since: 4.10
getWithAlpha
colorDialogGetWithAlpha Source #
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether colors may have alpha.
Since: 4.10
new
:: (HasCallStack, MonadIO m) | |
=> m ColorDialog | Returns: the new |
Creates a new GtkColorDialog
object.
Since: 4.10
setModal
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.
Since: 4.10
setTitle
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title that will be shown on the color chooser dialog.
Since: 4.10
setWithAlpha
colorDialogSetWithAlpha Source #
:: (HasCallStack, MonadIO m, IsColorDialog a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether colors may have alpha.
Since: 4.10
Properties
modal
Whether the color chooser dialog is modal.
Since: 4.10
constructColorDialogModal :: (IsColorDialog 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
.
getColorDialogModal :: (MonadIO m, IsColorDialog o) => o -> m Bool Source #
Get the value of the “modal
” property.
When overloading is enabled, this is equivalent to
get
colorDialog #modal
setColorDialogModal :: (MonadIO m, IsColorDialog o) => o -> Bool -> m () Source #
Set the value of the “modal
” property.
When overloading is enabled, this is equivalent to
set
colorDialog [ #modal:=
value ]
title
A title that may be shown on the color chooser
dialog that is presented by colorDialogChooseRgba
.
Since: 4.10
constructColorDialogTitle :: (IsColorDialog 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
.
getColorDialogTitle :: (MonadIO m, IsColorDialog o) => o -> m Text Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
colorDialog #title
setColorDialogTitle :: (MonadIO m, IsColorDialog o) => o -> Text -> m () Source #
Set the value of the “title
” property.
When overloading is enabled, this is equivalent to
set
colorDialog [ #title:=
value ]
withAlpha
Whether colors may have alpha (translucency).
When with-alpha is False
, the color that is selected
will be forced to have alpha == 1.
Since: 4.10
constructColorDialogWithAlpha :: (IsColorDialog o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “with-alpha
” property. This is rarely needed directly, but it is used by new
.
getColorDialogWithAlpha :: (MonadIO m, IsColorDialog o) => o -> m Bool Source #
Get the value of the “with-alpha
” property.
When overloading is enabled, this is equivalent to
get
colorDialog #withAlpha
setColorDialogWithAlpha :: (MonadIO m, IsColorDialog o) => o -> Bool -> m () Source #
Set the value of the “with-alpha
” property.
When overloading is enabled, this is equivalent to
set
colorDialog [ #withAlpha:=
value ]