1.30 <GtkColorDialogButton>

Class: <GtkColorDialogButton>

It derives from <GtkWidget>.

Opens a color chooser dialog to select a color.

It is suitable widget for selecting a color in a preference dialog.

CSS nodes

colorbutton
╰── button.color
    ╰── [content]

<GtkColorDialogButton> has a single CSS node with name colorbutton which contains a button node. To differentiate it from a plain <GtkButton>, it gets the .color style class.

Properties

Property: color-dialog-button:dialog self

The <GtkColorDialog> that contains parameters for the color chooser dialog.

Its value is a <GtkColorDialog>, or #f.

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

Property: color-dialog-button:rgba self

The selected color.

This property can be set to give the button its initial color, and it will be updated to reflect the users choice in the color chooser dialog.

Listen to notify::rgba to get informed about changes to the buttons color.

Its value is a <GdkRGBA>, or #f.

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

Procedures

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

Returns the <GtkColorDialog> of self.

self

Passed: a <GtkColorDialogButton>.

a <GtkColorDialogButton>

%return

Returned: a <GtkColorDialog>, or #f.

the <GtkColorDialog>

Method: color-dialog-button:get-rgba self ⇒ %return
Method: get-rgba self ⇒ %return

Returns the color of the button.

This function is what should be used to obtain the color that was chosen by the user. To get informed about changes, listen to "notify::rgba".

self

Passed: a <GtkColorDialogButton>.

a <GtkColorDialogButton>

%return

Returned: a <GdkRGBA>.

the color

Procedure: color-dialog-button:new [dialog] ⇒ %return

Creates a new <GtkColorDialogButton> with the given <GtkColorDialog>.

You can pass NULL to this function and set a <GtkColorDialog> later. The button will be insensitive until that happens.

dialog

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

the <GtkColorDialog> to use

%return

Returned: a <GtkWidget>.

the new <GtkColorDialogButton>

Method: color-dialog-button:set-dialog self dialog
Method: set-dialog self dialog

Sets a <GtkColorDialog> object to use for creating the color chooser dialog that is presented when the user clicks the button.

self

Passed: a <GtkColorDialogButton>.

a <GtkColorDialogButton>

dialog

Passed: a <GtkColorDialog>.

the new <GtkColorDialog>

Method: color-dialog-button:set-rgba self color
Method: set-rgba self color

Sets the color of the button.

self

Passed: a <GtkColorDialogButton>.

a <GtkColorDialogButton>

color

Passed: a <GdkRGBA>.

the new color

Signals

Signal: color-dialog-button:activate

Connect a handler with (connect object color-dialog-button:activate handler). It is called as (handler self).

Emitted when the color dialog button is activated.

The ::activate signal on <GtkColorDialogButton> is an action signal and emitting it causes the button to pop up its dialog.

self

Passed: a <GtkColorDialogButton>.