Gtk.ColorDialog¶
class — extends GObject.Object
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 ColorDialog.choose_rgba
function.
See ColorDialogButton for a convenient control
that uses GtkColorDialog and presents the results.
Constructors¶
new¶
Creates a new GtkColorDialog object.
Methods¶
choose_rgba¶
def choose_rgba(self, parent: Window | None = ..., initial_color: Gdk.RGBA | None = ..., cancellable: Gio.Cancellable | None = ..., callback: Gio.AsyncReadyCallback | None = ...) -> None
Presents a color chooser dialog to the user.
Parameters:
parent— the parent windowinitial_color— the color to select initiallycancellable— a cancellable to cancel the operationcallback— a callback to call when the operation is complete
choose_rgba_finish¶
Finishes the ColorDialog.choose_rgba call
Note that this function returns a DialogError.DISMISSED
error if the user cancels the dialog.
Parameters:
result— the result
get_modal¶
Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.
get_title¶
Returns the title that will be shown on the color chooser dialog.
get_with_alpha¶
Returns whether colors may have alpha.
set_modal¶
Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.
Parameters:
modal— the new value
set_title¶
Sets the title that will be shown on the color chooser dialog.
Parameters:
title— the new title
set_with_alpha¶
Sets whether colors may have alpha.
Parameters:
with_alpha— the new value
Properties¶
modal¶
Whether the color chooser dialog is modal.
title¶
A title that may be shown on the color chooser dialog.
with_alpha¶
Whether colors may have alpha (translucency).
When with-alpha is false, the color that is selected will be forced to have alpha == 1.