aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_toggle.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/elementary/src/bin/test_toggle.c')
-rw-r--r--legacy/elementary/src/bin/test_toggle.c66
1 files changed, 66 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_toggle.c b/legacy/elementary/src/bin/test_toggle.c
new file mode 100644
index 0000000000..4e524c74c5
--- /dev/null
+++ b/legacy/elementary/src/bin/test_toggle.c
@@ -0,0 +1,66 @@
+#include <Elementary.h>
+
+void
+test_toggle(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *win, *bg, *bx, *ic, *tg;
+ char buf[PATH_MAX];
+
+ win = elm_win_add(NULL, "toggles", ELM_WIN_BASIC);
+ elm_win_title_set(win, "Toggles");
+ elm_win_autodel_set(win, 1);
+
+ bg = elm_bg_add(win);
+ elm_win_resize_object_add(win, bg);
+ evas_object_size_hint_weight_set(bg, 1.0, 1.0);
+ evas_object_show(bg);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, 1.0, 1.0);
+ elm_win_resize_object_add(win, bx);
+ evas_object_show(bx);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+ tg = elm_toggle_add(win);
+ evas_object_size_hint_weight_set(tg, 1.0, 1.0);
+ evas_object_size_hint_align_set(tg, -1.0, 0.5);
+ elm_toggle_label_set(tg, "Icon sized to toggle");
+ elm_toggle_icon_set(tg, ic);
+ elm_toggle_state_set(tg, 1);
+ elm_toggle_states_labels_set(tg, "Yes", "No");
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+ evas_object_show(ic);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+ tg = elm_toggle_add(win);
+ elm_toggle_label_set(tg, "Icon no scale");
+ elm_toggle_icon_set(tg, ic);
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+ evas_object_show(ic);
+
+ tg = elm_toggle_add(win);
+ elm_toggle_label_set(tg, "Label Only");
+ elm_toggle_states_labels_set(tg, "Big long fun times label", "Small long happy fun label");
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+
+ ic = elm_icon_add(win);
+ snprintf(buf, sizeof(buf), "%s/images/logo_small.png", PACKAGE_DATA_DIR);
+ elm_icon_file_set(ic, buf, NULL);
+ elm_icon_scale_set(ic, 0, 0);
+ tg = elm_toggle_add(win);
+ elm_toggle_icon_set(tg, ic);
+ elm_box_pack_end(bx, tg);
+ evas_object_show(tg);
+ evas_object_show(ic);
+
+ evas_object_show(win);
+}