HildonColorButton

HildonColorButton — A widget to open HildonColorChooserDialog

Synopsis




            HildonColorButtonPrivate;
GtkWidget*  hildon_color_button_new         (void);
GtkWidget*  hildon_color_button_new_with_color
                                            (const GdkColor *color);
GdkColor*   hildon_color_button_get_color   (HildonColorButton *button);
void        hildon_color_button_set_color   (HildonColorButton *button,
                                             GdkColor *color);

Description

HildonColorButton is a widget to open a HildonColorChooserDialog. The selected color is shown in the button. The selected color is a property of the button. The property name is "color" and its type is GtkColor.

HildonColorButton *cbutton;
GtkColor *color;

cbutton = hildon_color_button_new();
gtk_object_get( GTK_OBJECT(cbutton), "color", color );

Details

HildonColorButtonPrivate

typedef struct _HildonColorButtonPrivate HildonColorButtonPrivate;


hildon_color_button_new ()

GtkWidget*  hildon_color_button_new         (void);

Creates a new color button. This returns a widget in the form of a small button containing a swatch representing the 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.

Returns : a new color button

hildon_color_button_new_with_color ()

GtkWidget*  hildon_color_button_new_with_color
                                            (const GdkColor *color);

Creates a new color button with color as the initial color.

color : a GdkColor for the initial color
Returns : a new color button

hildon_color_button_get_color ()

GdkColor*   hildon_color_button_get_color   (HildonColorButton *button);

button : a HildonColorButton
Returns : the color selected by the button

hildon_color_button_set_color ()

void        hildon_color_button_set_color   (HildonColorButton *button,
                                             GdkColor *color);

Sets the color selected by the button.

button : a HildonColorButton
color : a color to be set

See Also

HildonColorChooserDialog, HildonColorPopup