1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
6 #include <Elementary_Cursor.h>
9 _clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
11 elm_layout_text_set(data, "text", elm_object_text_get(obj));
15 test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
17 Evas_Object *win, *bg, *box, *ly, *bt;
20 win = elm_win_add(NULL, "layout", ELM_WIN_BASIC);
21 elm_win_title_set(win, "Layout");
22 elm_win_autodel_set(win, 1);
25 elm_win_resize_object_add(win, bg);
26 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
29 box = elm_box_add(win);
30 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
31 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
32 elm_win_resize_object_add(win, box);
33 evas_object_show(box);
35 ly = elm_layout_add(win);
36 elm_layout_theme_set(ly, "layout", "application", "titlebar");
37 elm_layout_label_set(ly, "Some title");
38 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
39 evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
40 elm_box_pack_end(box, ly);
43 bt = elm_icon_add(win);
44 elm_icon_standard_set(bt, "chat");
45 evas_object_size_hint_min_set(bt, 20, 20);
46 elm_layout_icon_set(ly, bt);
48 bt = elm_icon_add(win);
49 elm_icon_standard_set(bt, "close");
50 evas_object_size_hint_min_set(bt, 20, 20);
51 elm_layout_end_set(ly, bt);
53 ly = elm_layout_add(win);
54 snprintf(buf, sizeof(buf), "%s/objects/test.edj", PACKAGE_DATA_DIR);
55 elm_layout_file_set(ly, buf, "layout");
56 evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
57 elm_box_pack_end(box, ly);
58 //elm_win_resize_object_add(win, ly);
61 bt = elm_button_add(win);
62 elm_object_text_set(bt, "Button 1");
63 elm_layout_content_set(ly, "element1", bt);
64 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
67 bt = elm_button_add(win);
68 elm_object_text_set(bt, "Button 2");
69 elm_layout_content_set(ly, "element2", bt);
70 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
73 bt = elm_button_add(win);
74 elm_object_text_set(bt, "Button 3");
75 elm_layout_content_set(ly, "element3", bt);
76 evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
79 elm_layout_part_cursor_set(ly, "text", ELM_CURSOR_WATCH);
81 evas_object_show(win);