HildonCheckButton

HildonCheckButton — Button with a check box inside

Synopsis

                    HildonCheckButton;
GtkWidget*          hildon_check_button_new             (HildonSizeType size);
void                hildon_check_button_set_active      (HildonCheckButton *button,
                                                         gboolean is_active);
gboolean            hildon_check_button_get_active      (HildonCheckButton *button);
void                hildon_check_button_toggled         (HildonCheckButton *button);

Object Hierarchy

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

Implemented Interfaces

HildonCheckButton implements AtkImplementorIface and GtkBuildable.

Style Properties

  "checkbox-size"            guint                 : Read

Signals

  "toggled"                                        : Run First

Description

This is a button containing a check box and a label. Functions are provided to get and set the value of the check box. For the label use gtk_button_set_label(). Note that this button does NOT support an image, so don't use gtk_button_set_image()

Example 5. Using a Hildon check button

void
button_toggled (HildonCheckButton *button, gpointer user_data)
{
    gboolean active;

    active = hildon_check_button_get_active (button);
    if (active)
       g_debug ("Button is active");
    else
       g_debug ("Button is not active");
}

GtkWidget *
create_button (void)
{
    GtkWidget *button;

    button = hildon_check_button_new (HILDON_SIZE_AUTO);
    gtk_button_set_label (GTK_BUTTON (button), "Click me");

    g_signal_connect (button, "toggled", G_CALLBACK (button_toggled), NULL);

    return button;
}


Details

HildonCheckButton

typedef struct _HildonCheckButton HildonCheckButton;


hildon_check_button_new ()

GtkWidget*          hildon_check_button_new             (HildonSizeType size);

This function creates a HildonCheckButton.

size : Flags indicating the size of the new button
Returns : A newly created HildonCheckButton

Since 2.2


hildon_check_button_set_active ()

void                hildon_check_button_set_active      (HildonCheckButton *button,
                                                         gboolean is_active);

Sets the state of button to is_active

button : A HildonCheckButton
is_active : new state for the button

Since 2.2


hildon_check_button_get_active ()

gboolean            hildon_check_button_get_active      (HildonCheckButton *button);

Gets the state of the button.

button : A HildonCheckButton
Returns : TRUE if button is active, FALSE otherwise.

Since 2.2


hildon_check_button_toggled ()

void                hildon_check_button_toggled         (HildonCheckButton *button);

Emits the "toggled" signal on the HildonCheckButton.

button : A HildonCheckButton

Since 2.2

Style Property Details

The "checkbox-size" style property

  "checkbox-size"            guint                 : Read

Size of the check box.

Default value: 26

Signal Details

The "toggled" signal

void                user_function                      (HildonCheckButton *arg0,
                                                        gpointer           user_data)      : Run First

Emitted when the HildonCheckButton's state is changed

user_data : user data set when the signal handler was connected.

Since 2.2