projects
/
hildon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make HildonCheckButton derive from GtkToggleButton
[hildon]
/
examples
/
hildon-check-button-example.c
diff --git
a/examples/hildon-check-button-example.c
b/examples/hildon-check-button-example.c
index
fb2e8a9
..
4fe7cfd
100644
(file)
--- a/
examples/hildon-check-button-example.c
+++ b/
examples/hildon-check-button-example.c
@@
-20,14
+20,14
@@
*
*/
*
*/
-#include <hildon-check-button.h>
+#include <hildon/hildon.h>
static void
static void
-button_clicked_cb (GtkButton *button,
- GtkLabel *label)
+button_toggled_cb (GtkToggleButton *button,
+ GtkLabel *label)
{
{
- gboolean active = hildon_check_button_get_active (button);
- const gchar *labeltext = hildon_check_button_get_label (button);
+ gboolean active = gtk_toggle_button_get_active (button);
+ const gchar *labeltext = gtk_button_get_label (GTK_BUTTON (button));
char *text = g_strconcat (labeltext, active ? " (checked)" : " (unchecked)", NULL);
gtk_label_set_text (label, text);
g_free (text);
char *text = g_strconcat (labeltext, active ? " (checked)" : " (unchecked)", NULL);
gtk_label_set_text (label, text);
g_free (text);
@@
-43,7
+43,7
@@
main (int argc,
GtkWidget *table;
int i;
GtkWidget *table;
int i;
- gtk_init (&argc, &argv);
+ hildon_gtk_init (&argc, &argv);
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
vbox = GTK_BOX (gtk_vbox_new (FALSE, 10));
@@
-59,14
+59,14
@@
main (int argc,
char *text;
GtkWidget *button = hildon_check_button_new (HILDON_SIZE_HALFSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT);
text = g_strdup_printf ("Button %d", i+1);
char *text;
GtkWidget *button = hildon_check_button_new (HILDON_SIZE_HALFSCREEN_WIDTH | HILDON_SIZE_FINGER_HEIGHT);
text = g_strdup_printf ("Button %d", i+1);
- hildon_check_button_set_label (GTK_BUTTON (button), text);
+ gtk_button_set_label (GTK_BUTTON (button), text);
g_free (text);
gtk_table_attach_defaults (GTK_TABLE (table), button, i/2, (i/2) + 1, i%2, (i%2) + 1);
g_free (text);
gtk_table_attach_defaults (GTK_TABLE (table), button, i/2, (i/2) + 1, i%2, (i%2) + 1);
- g_signal_connect (button, "clicked", G_CALLBACK (button_clicked_cb), label);
+ g_signal_connect (button, "toggled", G_CALLBACK (button_toggled_cb), label);
}
gtk_box_pack_start (vbox, table, TRUE, TRUE, 0);
}
gtk_box_pack_start (vbox, table, TRUE, TRUE, 0);
- gtk_box_pack_start (vbox, gtk_label_new ("Last clicked:"), TRUE, TRUE, 0);
+ gtk_box_pack_start (vbox, gtk_label_new ("Last toggled:"), TRUE, TRUE, 0);
gtk_box_pack_start (vbox, label, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (win), 20);
gtk_box_pack_start (vbox, label, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (win), 20);