HildonColorButton

HildonColorButton — A widget to open HildonColorChooserDialog.

Synopsis




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

Object Hierarchy


  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GtkWidget
                     +----GtkContainer
                           +----GtkBin
                                 +----GtkButton
                                       +----HildonColorButton

Implemented Interfaces

HildonColorButton implements AtkImplementorIface and GtkBuildable.

Properties


  "color"                    GdkColor              : Read / Write
  "popup-shown"              gboolean              : Read

Signals


  "setup-dialog"                                   : Run Last

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.

Example 3. HildonColorButton example

HildonColorButton *cbutton;
GtkColor *color;

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


Details

HildonColorButton

typedef struct _HildonColorButton HildonColorButton;


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

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

button :

a HildonColorButton

color :

a color GdkColor to be fillled with the current color

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

hildon_color_button_get_popup_shown ()

gboolean            hildon_color_button_get_popup_shown (HildonColorButton *button);

This function checks if the color button has the color selection dialog currently popped-up.

button :

a HildonColorButton

Returns :

TRUE if the dialog is popped-up (visible to user).

hildon_color_button_popdown ()

void                hildon_color_button_popdown         (HildonColorButton *button);

If the color selection dialog is currently popped-up (visible) it will be popped-down (hidden).

button :

a HildonColorButton

Property Details

The "color" property

  "color"                    GdkColor              : Read / Write

The currently selected color.


The "popup-shown" property

  "popup-shown"              gboolean              : Read

If the color selection dialog is currently popped-up (visible)

Default value: FALSE

Signal Details

The "setup-dialog" signal

void                user_function                      (HildonColorButton        *hildoncolorbutton,
                                                        HildonColorChooserDialog *arg1,
                                                        gpointer                  user_data)              : Run Last

hildoncolorbutton :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

See Also

HildonColorChooserDialog, HildonColorPopup