1.29 <GtkColorDialog>

Class: <GtkColorDialog>

It derives from <GObject>.

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 color-dialog:choose-rgba function.

See <GtkColorDialogButton> for a convenient control that uses <GtkColorDialog> and presents the results.

Properties

Property: color-dialog:modal self

Whether the color chooser dialog is modal.

Its value is a boolean.

Set it with (set! (color-dialog:modal self) value).

Property: color-dialog:title self

A title that may be shown on the color chooser dialog.

Its value is a string, or #f.

Set it with (set! (color-dialog:title self) value).

Property: color-dialog:with-alpha self

Whether colors may have alpha (translucency).

When with-alpha is false, the color that is selected will be forced to have alpha == 1.

Its value is a boolean.

Set it with (set! (color-dialog:with-alpha self) value).

Procedures

Method: color-dialog:choose-rgba self [parent] [initial-color] [cancellable] [callback]
Method: choose-rgba self [parent] [initial-color] [cancellable] [callback]

Presents a color chooser dialog to the user.

self

Passed: a <GtkColorDialog>.

a color dialog

parent

Passed, or left out: a <GtkWindow>, or #f.

the parent window

initial-color

Passed, or left out: a <GdkRGBA>, or #f.

the color to select initially

cancellable

Passed, or left out: a <GCancellable>, or #f.

a cancellable to cancel the operation

callback

Passed, or left out: a procedure, or #f.

a callback to call when the operation is complete

See GAsyncReadyCallback for how it is called.

user-data

Not passed: guile-gi supplies it.

data to pass to callback

Method: color-dialog:choose-rgba-finish self result ⇒ %return
Method: choose-rgba-finish self result ⇒ %return

Finishes the color-dialog:choose-rgba call

Note that this function returns a Gtk.DialogError.DISMISSED error if the user cancels the dialog.

self

Passed: a <GtkColorDialog>.

a color dialog

result

Passed: a <GAsyncResult>.

the result

%return

Returned: a <GdkRGBA>.

the selected color

Method: color-dialog:get-modal? self ⇒ %return
Method: get-modal? self ⇒ %return

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

self

Passed: a <GtkColorDialog>.

a color dialog

%return

Returned: a boolean.

true if the color chooser dialog is modal

Method: color-dialog:get-title self ⇒ %return
Method: get-title self ⇒ %return

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

self

Passed: a <GtkColorDialog>.

a color dialog

%return

Returned: a string.

the title

Method: color-dialog:get-with-alpha? self ⇒ %return
Method: get-with-alpha? self ⇒ %return

Returns whether colors may have alpha.

self

Passed: a <GtkColorDialog>.

a color dailog

%return

Returned: a boolean.

true if colors may have alpha

Procedure: color-dialog:new ⇒ %return

Creates a new <GtkColorDialog> object.

%return

Returned: a <GtkColorDialog>.

the new <GtkColorDialog>

Method: color-dialog:set-modal self modal
Method: set-modal self modal

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

self

Passed: a <GtkColorDialog>.

a color dialog

modal

Passed: a boolean.

the new value

Method: color-dialog:set-title self title
Method: set-title self title

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

self

Passed: a <GtkColorDialog>.

a color dialog

title

Passed: a string.

the new title

Method: color-dialog:set-with-alpha self with-alpha
Method: set-with-alpha self with-alpha

Sets whether colors may have alpha.

self

Passed: a <GtkColorDialog>.

a color dialog

with-alpha

Passed: a boolean.

the new value