HildonCheckButton

HildonCheckButton — Button with a check box inside

Synopsis

                    HildonCheckButtonPrivate;
                    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.

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

HildonCheckButtonPrivate

typedef struct _HildonCheckButtonPrivate HildonCheckButtonPrivate;


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

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

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.

hildon_check_button_toggled ()

void                hildon_check_button_toggled         (HildonCheckButton *button);

Emits the "toggled" signal on the HildonCheckButton.

button : A HildonCheckButton

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.