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

GI.Gtk.Objects.ColorDialog

Description

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

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

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

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

Methods

gvalueGType_ :: IO GType

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

gvalueGet_ :: Ptr GValue -> IO (Maybe 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 GtkColorDialog

-> Maybe b

parent: the parent GtkWindow

-> Maybe RGBA

initialColor: the color to select initially

-> Maybe c

cancellable: a GCancellable to cancel the operation

-> Maybe AsyncReadyCallback

callback: a callback to call when the operation is complete

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

Arguments

:: (HasCallStack, MonadIO m, IsColorDialog a, IsAsyncResult b) 
=> a

self: a GtkColorDialog

-> b

result: a GAsyncResult

-> m (Maybe RGBA)

Returns: the selected color, or NULL and error is set (Can throw GError)

Finishes the colorDialogChooseRgba call and returns the resulting color.

Since: 4.10

getModal

colorDialogGetModal Source #

Arguments

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

self: a GtkColorDialog

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

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

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

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

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

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