GIMP Widgets Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct GimpColorButton; GtkWidget* gimp_color_button_new (const gchar *title, gint width, gint height, const GimpRGB *color, GimpColorAreaType type); void gimp_color_button_set_color (GimpColorButton *gcb, const GimpRGB *color); void gimp_color_button_get_color (GimpColorButton *gcb, GimpRGB *color); gboolean gimp_color_button_has_alpha (GimpColorButton *gcb); void gimp_color_button_set_type (GimpColorButton *gcb, GimpColorAreaType type); |
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkButton +----GimpButton +----GimpColorButton |
"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 (const gchar *title, gint width, gint height, const GimpRGB *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 GimpRGB color. |
type : | |
Returns : | Pointer to the new GimpColorButton widget. |
void gimp_color_button_set_color (GimpColorButton *gcb, const GimpRGB *color); |
gcb : | Pointer to a GimpColorButton. |
color : | Pointer to the new GimpRGB color. |
void gimp_color_button_get_color (GimpColorButton *gcb, GimpRGB *color); |
gcb : | Pointer to a GimpColorButton. |
color : |
gboolean gimp_color_button_has_alpha (GimpColorButton *gcb); |
gcb : | Pointer to a GimpColorButton. |
Returns : |
void gimp_color_button_set_type (GimpColorButton *gcb, GimpColorAreaType type); |
void user_function (GimpColorButton *gimpcolorbutton, gpointer user_data); |