This ColorButton launches a color selection dialog and prints in the terminal the RGB values of the color selected.
set_color(color)
, where the color
is defined as in the example, sets the color of the ColorButton, which by default is black. get_color()
returns the color.
In line 23 the "color-set"
signal is connected to the callback function on_color_chosen()
using widget.connect(signal, callback function)
. See for a more detailed explanation.
In this sample we used the following:
GtkColorButton
GtkColorChooser
RGBA Colors