ColorDialog#
Added in version 4.10.
Superclasses: 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 choose_rgba
function.
See ColorDialogButton for a convenient control
that uses GtkColorDialog and presents the results.
Constructors#
- class ColorDialog
- classmethod new() ColorDialog#
Creates a new
GtkColorDialogobject.Added in version 4.10.
Methods#
- class ColorDialog
- async choose_rgba(self, parent: Window | None = None, initial_color: RGBA | None = None) RGBA#
This is the awaitable version of
choose_rgba().Added in version 4.10.
- Parameters:
parent – the parent window
initial_color – the color to select initially
- choose_rgba(parent: Window | None = None, initial_color: RGBA | None = None, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
Presents a color chooser dialog to the user.
Added in version 4.10.
- Parameters:
parent – the parent window
initial_color – the color to select initially
cancellable – a cancellable to cancel the operation
callback – a callback to call when the operation is complete
user_data – data to pass to
callback
- choose_rgba_finish(result: AsyncResult) RGBA#
Finishes the
choose_rgbacallNote that this function returns a
DISMISSEDerror if the user cancels the dialog.Added in version 4.10.
- Parameters:
result – the result
- get_modal() bool#
Returns whether the color chooser dialog blocks interaction with the parent window while it is presented.
Added in version 4.10.
- get_title() str#
Returns the title that will be shown on the color chooser dialog.
Added in version 4.10.
- set_modal(modal: bool) None#
Sets whether the color chooser dialog blocks interaction with the parent window while it is presented.
Added in version 4.10.
- Parameters:
modal – the new value
Properties#
- class ColorDialog