| GIMP Widgets Library Reference Manual |
|---|
GimpColorButton — Widget for selecting a color.
struct GimpColorButton;GtkWidget * gimp_color_button_new (constgchar *title,gint width,gint height, constGimpRGB *color, GimpColorAreaType type); void gimp_color_button_set_color (GimpColorButton *button, constGimpRGB *color); void gimp_color_button_get_color (GimpColorButton *button,GimpRGB *color);gboolean gimp_color_button_has_alpha (GimpColorButton *button); void gimp_color_button_set_type (GimpColorButton *button, GimpColorAreaType type);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkButton +----GimpButton +----GimpColorButton
GimpColorButton implements
"color-changed" void user_function (GimpColorButton *gimpcolorbutton,gpointer user_data);
This widget provides a simple button with a preview showing the color.
On click a GtkColorSelectionDialog is opened. Additionally the button supports Drag and Drop and has a right-click menu that allows to choose the color from the current FG or BG color. If the user changes the color, the "color_changed" signal is emitted.
GtkWidget * gimp_color_button_new (constgchar *title,gint width,gint height, constGimpRGB *color, GimpColorAreaType type);
Creates a new GimpColorButton widget.
This returns a button with a preview showing the color. When the button is clicked a GtkColorSelectionDialog is opened. If the user changes the color the new color is written into the array that was used to pass the initial color and the "color_changed" signal is emitted.
| title : | String that will be used as title for the color_selector. |
| width : | Width of the colorpreview in pixels. |
| height : | Height of the colorpreview in pixels. |
| color : | A pointer to a |
| type : | |
| Returns : | Pointer to the new GimpColorButton widget. |
void gimp_color_button_set_color (GimpColorButton *button, constGimpRGB *color);
Sets the button to the given color.
| button : | Pointer to a GimpColorButton. |
| color : | Pointer to the new |
void gimp_color_button_get_color (GimpColorButton *button,GimpRGB *color);
Retrieves the currently set color from the button.
| button : | Pointer to a GimpColorButton. |
| color : | Pointer to a |
gboolean gimp_color_button_has_alpha (GimpColorButton *button);
Checks whether the buttons shows transparency information.
| button : | Pointer to a GimpColorButton. |
| Returns : | TRUE if the button shows transparency information, FALSE otherwise. |
void gimp_color_button_set_type (GimpColorButton *button, GimpColorAreaType type);
Sets the button to the given type. See also gimp_color_area_set_type().
| button : | Pointer to a GimpColorButton. |
| type : | the new GimpColorAreaType |
void user_function (GimpColorButton *gimpcolorbutton,gpointer user_data);
| gimpcolorbutton : | the object which received the signal. |
| user_data : | user data set when the signal handler was connected. |
| << GimpColorArea | GimpColorScale >> |