gi-gtk4-4.0.12: Gtk 4.x bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.ColorDialog

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

Exported types

newtype ColorDialog Source #

Memory-managed wrapper type.

Instances

Instances details
Eq ColorDialog Source # 
Instance details

Defined in GI.Gtk.Objects.ColorDialog

GObject ColorDialog Source # 
Instance details

Defined in GI.Gtk.Objects.ColorDialog

ManagedPtrNewtype ColorDialog Source # 
Instance details

Defined in GI.Gtk.Objects.ColorDialog

TypedObject ColorDialog Source # 
Instance details

Defined in GI.Gtk.Objects.ColorDialog

Methods

glibType :: IO GType #

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

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

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 (Maybe RGBA)

Returns: the selected color (Can throw GError)

Finishes the colorDialogChooseRgba call

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 ]