A button to launch a color selection dialog
The <gtk-color-button>
is a button which displays the currently selected
color an allows to open a color selection dialog to change the color. It is
suitable widget for selecting a color in a preference dialog.
Derives from
<gtk-button>
.This class defines the following slots:
use-alpha
- Whether or not to give the color an alpha value
title
- The title of the color selection dialog
color
- The selected color
alpha
- The selected opacity value (0 fully transparent, 65535 fully opaque)
The ::color-set signal is emitted when the user selects a color. When handling this signal, use
gtk-color-button-get-color
andgtk-color-button-get-alpha
to find out which color was just selected.Note that this signal is only emitted when the user changes the color. If you need to react to programmatic color changes as well, use the notify::color signal.
Since 2.4
<gtk-widget>
)Creates a new color button. This returns a widget in the form of a small button containing a swatch representing the current selected color. When the button is clicked, a color-selection dialog will open, allowing the user to select a color. The swatch will be updated to reflect the new color when the user finishes.
- ret
- a new color button.
Since 2.4
<gdk-color>
) ⇒ (ret <gtk-widget>
)Creates a new color button.
- color
- A
<gdk-color>
to set the current color with.- ret
- a new color button.
Since 2.4
<gtk-color-button>
) (color <gdk-color>
)Sets the current color to be color.
- color-button
- a
<gtk-color-button>
.- color
- A
<gdk-color>
to set the current color with.Since 2.4
<gtk-color-button>
) (color <gdk-color>
)Sets color to be the current color in the
<gtk-color-button>
widget.
- color-button
- a
<gtk-color-button>
.- color
- a
<gdk-color>
to fill in with the current color.Since 2.4
<gtk-color-button>
) (alpha unsigned-int16
)Sets the current opacity to be alpha.
- color-button
- a
<gtk-color-button>
.- alpha
- an integer between 0 and 65535.
Since 2.4
<gtk-color-button>
) ⇒ (ret unsigned-int16
)Returns the current alpha value.
- color-button
- a
<gtk-color-button>
.- ret
- an integer between 0 and 65535.
Since 2.4
<gtk-color-button>
) (use_alpha bool
)Sets whether or not the color button should use the alpha channel.
- color-button
- a
<gtk-color-button>
.- use-alpha
- ‘
#t
’ if color button should use alpha channel, ‘#f
’ if not.Since 2.4
<gtk-color-button>
) ⇒ (ret bool
)Does the color selection dialog use the alpha channel?
- color-button
- a
<gtk-color-button>
.- ret
- ‘
#t
’ if the color sample uses alpha channel, ‘#f
’ if not.Since 2.4