GimpColorButton

Name

GimpColorButton -- Widget for selecting a color.

Synopsis



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);

Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkContainer
                     +----GtkBin
                           +----GtkButton
                                 +----GimpButton
                                       +----GimpColorButton

Signal Prototypes


"color-changed"
            void        user_function      (GimpColorButton *gimpcolorbutton,
                                            gpointer user_data);

Description

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.

Details

struct GimpColorButton

struct GimpColorButton;


gimp_color_button_new ()

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.


gimp_color_button_set_color ()

void        gimp_color_button_set_color     (GimpColorButton *gcb,
                                             const GimpRGB *color);


gimp_color_button_get_color ()

void        gimp_color_button_get_color     (GimpColorButton *gcb,
                                             GimpRGB *color);


gimp_color_button_has_alpha ()

gboolean    gimp_color_button_has_alpha     (GimpColorButton *gcb);


gimp_color_button_set_type ()

void        gimp_color_button_set_type      (GimpColorButton *gcb,
                                             GimpColorAreaType type);

Signals

The "color-changed" signal

void        user_function                  (GimpColorButton *gimpcolorbutton,
                                            gpointer user_data);

See Also

libgimpcolor-gimpcolorspace