Gtk.ColorDialog

g GObject.Object GObject.Object Gtk.ColorDialog Gtk.ColorDialog GObject.Object->Gtk.ColorDialog

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

choose_rgba (parent, initial_color, cancellable, callback, *user_data)

choose_rgba_finish (result)

get_modal ()

get_title ()

get_with_alpha ()

set_modal (modal)

set_title (title)

set_with_alpha (with_alpha)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

modal

bool

r/w/en

title

str

r/w/en

with-alpha

bool

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.ColorDialog(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Gtk.ColorDialogClass

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 [method`Gtk`.ColorDialog.choose_rgba] function. This API follows the GIO async pattern, and the result can be obtained by calling [method`Gtk`.ColorDialog.choose_rgba_finish].

See [class`Gtk`.ColorDialogButton] for a convenient control that uses GtkColorDialog and presents the results.

New in version 4.10.

classmethod new()[source]
Returns:

the new GtkColorDialog

Return type:

Gtk.ColorDialog

Creates a new GtkColorDialog object.

New in version 4.10.

choose_rgba(parent, initial_color, cancellable, callback, *user_data)[source]
Parameters:

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 [method`Gtk`.ColorDialog.choose_rgba_finish] to obtain the result.

New in version 4.10.

choose_rgba_finish(result)[source]
Parameters:

result (Gio.AsyncResult) – a GAsyncResult

Raises:

GLib.Error

Returns:

the selected color, or NULL and error is set

Return type:

Gdk.RGBA or None

Finishes the [method`Gtk`.ColorDialog.choose_rgba] call and returns the resulting color.

New in version 4.10.

get_modal()[source]
Returns:

TRUE if the color chooser dialog is modal

Return type:

bool

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

New in version 4.10.

get_title()[source]
Returns:

the title

Return type:

str

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

New in version 4.10.

get_with_alpha()[source]
Returns:

TRUE if colors may have alpha

Return type:

bool

Returns whether colors may have alpha.

New in version 4.10.

set_modal(modal)[source]
Parameters:

modal (bool) – the new value

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

New in version 4.10.

set_title(title)[source]
Parameters:

title (str) – the new title

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

New in version 4.10.

set_with_alpha(with_alpha)[source]
Parameters:

with_alpha (bool) – the new value

Sets whether colors may have alpha.

New in version 4.10.

Property Details

Gtk.ColorDialog.props.modal
Name:

modal

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the color chooser dialog is modal.

New in version 4.10.

Gtk.ColorDialog.props.title
Name:

title

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A title that may be shown on the color chooser dialog that is presented by [method`Gtk`.ColorDialog.choose_rgba].

New in version 4.10.

Gtk.ColorDialog.props.with_alpha
Name:

with-alpha

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether colors may have alpha (translucency).

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

New in version 4.10.