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

Contents

- Exported types
- Methods
  - chooseRgba
  - chooseRgbaFinish
  - getModal
  - getTitle
  - getWithAlpha
  - new
  - setModal
  - setTitle
  - setWithAlpha
- Properties
  - modal
  - title
  - withAlpha

Description

Asynchronous API to present a color chooser dialog.

`GtkColorDialog` collects the arguments that are needed to present the 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.

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

Constructors

ColorDialog (ManagedPtr ColorDialog) |

#### Instances

Instances details

Eq ColorDialog Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialog Methods (==) :: ColorDialog -> ColorDialog -> Bool Source # (/=) :: ColorDialog -> ColorDialog -> Bool Source #
GObject ColorDialog Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialog
ManagedPtrNewtype ColorDialog Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialog Methods toManagedPtr :: ColorDialog -> ManagedPtr ColorDialog Source #
TypedObject ColorDialog Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialog Methods glibType :: IO GType Source #
HasParentTypes ColorDialog Source # |
Instance details Defined in GI.Gtk.Objects.ColorDialog
IsGValue (Maybe ColorDialog) Source # | Convert `ColorDialog` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.ColorDialog Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ColorDialog -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ColorDialog) Source #
type ParentTypes ColorDialog Source # |
Instance details 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

Instances details

(GObject o, IsDescendantOf ColorDialog o) => IsColorDialog o Source # |
Instance details 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

Expand

#### 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 #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a, IsWindow b, IsCancellable c) |
=> a | `self`: a color dialog
-> Maybe b | `parent`: the parent window
-> Maybe RGBA | `initialColor`: the color to select initially
-> Maybe c | `cancellable`: a cancellable to cancel the operation
-> Maybe AsyncReadyCallback | `callback`: a callback to call when the operation is complete
-> m () |

Presents a color chooser dialog to the user.

Since: 4.10

## chooseRgbaFinish

colorDialogChooseRgbaFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a, IsAsyncResult b) |
=> a | `self`: a color dialog
-> b | `result`: the result
-> m RGBA | Returns: the selected color (Can throw `GError`)

Finishes the `colorDialogChooseRgba` call

Note that this function returns a [error`gtk`.DialogError.DISMISSED] error if the user cancels the dialog.

Since: 4.10

## getModal

colorDialogGetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dialog
-> m Bool | Returns: true if the color chooser dialog is modal

Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

## getTitle

colorDialogGetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dialog
-> m Text | Returns: the title

Returns the title that will be shown on the color chooser dialog.

Since: 4.10

## getWithAlpha

colorDialogGetWithAlpha Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dailog
-> m Bool | Returns: true if colors may have alpha

Returns whether colors may have alpha.

Since: 4.10

## new

colorDialogNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m ColorDialog | Returns: the new `GtkColorDialog`

Creates a new `GtkColorDialog` object.

Since: 4.10

## setModal

colorDialogSetModal Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dialog
-> Bool | `modal`: the new value
-> m () |

Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.

Since: 4.10

## setTitle

colorDialogSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dialog
-> Text | `title`: the new title
-> m () |

Sets the title that will be shown on the color chooser dialog.

Since: 4.10

## setWithAlpha

colorDialogSetWithAlpha Source #

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a) |
=> a | `self`: a color dialog
-> Bool | `withAlpha`: the new value
-> 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.

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 ]