gtk.color_button

Module for [ColorButton] class

Types 3

The [gtk.color_button.ColorButton] allows to open a color chooser dialog to change the color.

!An example GtkColorButton

It is suitable widget for selecting a color in a preference dialog.

CSS nodes

colorbutton
╰── button.color
   ╰── [content]

[gtk.color_button.ColorButton] has a single CSS node with name colorbutton which contains a button node. To differentiate it from a plain [gtk.button.Button], it gets the .color style class.

Deprecated

Use [gtk.color_dialog_button.ColorDialogButton] instead
Methods
GType _gType() @property
ColorButton self()Returns `this`, for use in `with` statements.
ColorButtonGidBuilder builder()Get builder for [gtk.color_button.ColorButton] Returns: New builder object
bool modal() @propertyGet `modal` property. Returns: Whether the color chooser dialog should be modal.
void modal(bool propval) @propertySet `modal` property. Params: propval = Whether the color chooser dialog should be modal.
bool showEditor() @propertyGet `showEditor` property. Returns: Whether the color chooser should open in editor mode.
void showEditor(bool propval) @propertySet `showEditor` property. Params: propval = Whether the color chooser should open in editor mode.
string title() @propertyGet `title` property. Returns: The title of the color chooser dialog
void title(string propval) @propertySet `title` property. Params: propval = The title of the color chooser dialog
gtk.color_button.ColorButton newWithRgba(gdk.rgba.RGBA rgba)Creates a new color button showing the given color.
bool getModal()Gets whether the dialog is modal. Returns: true if the dialog is modal
string getTitle()Gets the title of the color chooser dialog. Returns: An internal string, do not free the return value
void setModal(bool modal)Sets whether the dialog should be modal.
void setTitle(string title)Sets the title for the color chooser dialog.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.color_button.ColorButton))) && Parameters!T.length < 2)Connect to `Activate` signal.
gulong connectColorSet(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.color_button.ColorButton))) && Parameters!T.length < 2)Connect to `ColorSet` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new color button.
Methods
T modal(bool propval)Set `modal` property. Params: propval = Whether the color chooser dialog should be modal. Returns: Builder instance for fluent chaining
T showEditor(bool propval)Set `showEditor` property. Params: propval = Whether the color chooser should open in editor mode.
T title(string propval)Set `title` property. Params: propval = The title of the color chooser dialog Returns: Builder instance for fluent chaining

Fluent builder for [gtk.color_button.ColorButton]