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 [methodGtk.ColorDialog.choose_rgba] function.
See [classGtk.ColorDialogButton] for a convenient control that uses GtkColorDialog and presents the results.
<group>Dialogs</group>
procedure Choose_Rgba
(Self : not null access Gtk_Color_Dialog_Record;
Parent : access Gtk.Window.Gtk_Window_Record'Class;
Initial_Color : Gdk.RGBA.Gdk_RGBA;
Cancellable : access Glib.Cancellable.Gcancellable_Record'Class;
Callback : Gasync_Ready_Callback)
Presents a color chooser dialog to the user. Since: gtk+ 4.10
the parent window
the color to select initially
a cancellable to cancel the operation
a callback to call when the operation is complete
function Choose_Rgba_Finish
(Self : not null access Gtk_Color_Dialog_Record;
Result : Glib.G_Async_Result;
Error : out Glib.Error.GError) return Gdk.RGBA.Gdk_RGBA
Finishes the [methodGtk.ColorDialog.choose_rgba] call Note that this function returns a [errorGtk.DialogError.DISMISSED] error if the user cancels the dialog. Since: gtk+ 4.10
the result
the return location for a recoverable error
the selected color
type Gasync_Ready_Callback is access procedure
(Source_Object : access Glib.Object.GObject_Record'Class;
Res : Glib.G_Async_Result);
Type definition for a function that will be called back when an asynchronous operation within GIO has been completed. Gasync_Ready_Callback callbacks from Gtask.Gtask are guaranteed to be invoked in a later iteration of the thread-default main context (see [methodGlib.MainContext.push_thread_default]) where the Gtask.Gtask was created. All other users of Gasync_Ready_Callback must likewise call it asynchronously in a later iteration of the main context. The asynchronous operation is guaranteed to have held a reference to Source_Object from the time when the *_async function was called, until after this callback returns.
the object the asynchronous operation was started with.
a Glib.G_Async_Result.
function Get_Modal
(Self : not null access Gtk_Color_Dialog_Record) return Boolean
Returns whether the color chooser dialog blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
true if the color chooser dialog is modal
function Get_Title
(Self : not null access Gtk_Color_Dialog_Record) return UTF8_String
Returns the title that will be shown on the color chooser dialog. Since: gtk+ 4.10
the title
function Get_Type return Glib.GType
function Get_With_Alpha
(Self : not null access Gtk_Color_Dialog_Record) return Boolean
Returns whether colors may have alpha. Since: gtk+ 4.10
true if colors may have alpha
type Gtk_Color_Dialog is access all Gtk_Color_Dialog_Record'Class;
function Gtk_Color_Dialog_New return Gtk_Color_Dialog
Creates a new GtkColorDialog object. Since: gtk+ 4.10
type Gtk_Color_Dialog_Record is new GObject_Record with null record;
procedure Gtk_New (Self : out Gtk_Color_Dialog)
Creates a new GtkColorDialog object. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize
(Self : not null access Gtk_Color_Dialog_Record'Class)
Creates a new GtkColorDialog object. Since: gtk+ 4.10 Initialize does nothing if the object was already created with another call to Initialize* or G_New.
Modal_Property : constant Glib.Properties.Property_Boolean;
Whether the color chooser dialog is modal.
procedure Set_Modal
(Self : not null access Gtk_Color_Dialog_Record;
Modal : Boolean)
Sets whether the color chooser dialog blocks interaction with the parent window while it is presented. Since: gtk+ 4.10
the new value
procedure Set_Title
(Self : not null access Gtk_Color_Dialog_Record;
Title : UTF8_String)
Sets the title that will be shown on the color chooser dialog. Since: gtk+ 4.10
the new title
procedure Set_With_Alpha
(Self : not null access Gtk_Color_Dialog_Record;
With_Alpha : Boolean)
Sets whether colors may have alpha. Since: gtk+ 4.10
the new value
Title_Property : constant Glib.Properties.Property_String;
A title that may be shown on the color chooser dialog.
With_Alpha_Property : constant Glib.Properties.Property_Boolean;
Whether colors may have alpha (translucency).
When with-alpha is false, the color that is selected will be forced to have alpha == 1.