A button to launch a color selection dialog
Class GtkColorButton
The GtkColorButton 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.
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.
Methods | |
get_alpha | Returns the current alpha value. |
get_color | Gets the current color. |
get_title | Gets the title of the color selection dialog. |
get_use_alpha | Does the color selection dialog use the alpha channel? |
new_with_color | Creates a new color button. |
set_alpha | Sets the current opacity to be alpha. |
set_color | Sets the current color to be color. |
set_title | Sets the title for the color selection dialog. |
set_use_alpha | Sets whether or not the color button should use the alpha channel. |
signal_color_set | The color-set signal is emitted when the user selects a color. |
Returns the current alpha value.
GtkColorButton.get_alpha()
Return | an integer between 0 and 65535. |
Gets the current color.
GtkColorButton.get_color()
Return | GdkColor of the widget. |
Gets the title of the color selection dialog.
GtkColorButton.get_title()
Return | The title. |
Does the color selection dialog use the alpha channel?
GtkColorButton.get_use_alpha()
Return | true if the color sample uses alpha channel, false if not. |
Creates a new color button.
GtkColorButton.new_with_color( color )
color | A GdkColor to set the current color with. |
Return | a new color button. |
Sets the current opacity to be alpha.
GtkColorButton.set_alpha( alpha )
alpha | an integer between 0 and 65535. |
Sets the current color to be color.
GtkColorButton.set_color( color )
color | A GdkColor to set the current color with. |
Sets the title for the color selection dialog.
GtkColorButton.set_title( title )
title | String containing new window title. |
Sets whether or not the color button should use the alpha channel.
GtkColorButton.set_use_alpha( use_alpha )
use_alpha | true if color button should use alpha channel, false if not. |
The color-set signal is emitted when the user selects a color.
GtkColorButton.signal_color_set()
When handling this signal, use gtk_color_button_get_color() and gtk_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.