Class: Gtk::ColorDialog

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtk::ColorDialog

Creates a new GtkColorDialog object.

Instance Method Details

#choose_rgba(parent, initial_color, cancellable, callback, user_data) ⇒ nil

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

Parameters:

  • parent (Gtk::Window)

    the parent GtkWindow

  • initial_color (Gdk::RGBA)

    the color to select initially

  • cancellable (Gio::Cancellable)

    a GCancellable to cancel the operation

  • callback (Gio::AsyncReadyCallback)

    a callback to call when the operation is complete

  • user_data (GObject)

    data to pass to callback

Returns:

  • (nil)

#choose_rgba_finish(result) ⇒ Gdk::RGBA

Finishes the [methodGtk.ColorDialog.choose_rgba] call and returns the resulting color.

Parameters:

  • result (Gio::AsyncResult)

    a GAsyncResult

Returns:

  • (Gdk::RGBA)

    the selected color, or NULL and error is set

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

Returns:

  • (Boolean)

    TRUE if the color chooser dialog is modal

#modal=(modal) ⇒ Boolean

Whether the color chooser dialog is modal.

Parameters:

  • modal (Boolean)

Returns:

  • (Boolean)

    modal

  • (Boolean)

    modal

#modal?Boolean

Whether the color chooser dialog is modal.

Returns:

  • (Boolean)

    modal

#titleString

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

Returns:

  • (String)

    title

#title=(title) ⇒ String

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

Parameters:

  • title (String)

Returns:

  • (String)

    title

  • (String)

    title

#with_alphaBoolean

Returns whether colors may have alpha.

Returns:

  • (Boolean)

    TRUE if colors may have alpha

#with_alpha=(with_alpha) ⇒ Boolean

Whether colors may have alpha (translucency).

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

Parameters:

  • with_alpha (Boolean)

Returns:

  • (Boolean)

    with-alpha

  • (Boolean)

    with-alpha

#with_alpha?Boolean

Whether colors may have alpha (translucency).

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

Returns:

  • (Boolean)

    with-alpha