| hildon 2.1.34 Reference Manual | ||||
|---|---|---|---|---|
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);
GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkButton
+----HildonCheckButton
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;
}
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
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
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
void hildon_check_button_toggled (HildonCheckButton *button);
Emits the "toggled" signal on the HildonCheckButton.
button : |
A HildonCheckButton |
Since 2.2
"toggled" signalvoid 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