1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 _ch_grid(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
11 elm_grid_pack_get(obj, &x, &y, &w, &h);
12 elm_grid_pack_set(obj, x - 1, y - 1, w + 2, h + 2);
16 test_grid(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
18 Evas_Object *win, *bg, *gd, *bt, *rc, *en;
20 win = elm_win_add(NULL, "grid", ELM_WIN_BASIC);
21 elm_win_title_set(win, "Grid");
22 elm_win_autodel_set(win, 1);
25 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
26 elm_win_resize_object_add(win, bg);
29 gd = elm_grid_add(win);
30 elm_grid_size_set(gd, 100, 100);
31 elm_win_resize_object_add(win, gd);
32 evas_object_size_hint_weight_set(gd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
35 en = elm_entry_add(win);
36 elm_entry_scrollable_set(en, EINA_TRUE);
37 elm_entry_entry_set(en, "Entry text");
38 elm_entry_single_line_set(en, 1);
39 elm_grid_pack(gd, en, 50, 10, 40, 10);
42 en = elm_entry_add(win);
43 elm_entry_scrollable_set(en, EINA_TRUE);
44 elm_entry_entry_set(en, "Entry text 2");
45 elm_entry_single_line_set(en, 1);
46 elm_grid_pack(gd, en, 60, 20, 30, 10);
49 bt = elm_button_add(win);
50 elm_button_label_set(bt, "Button");
51 elm_grid_pack(gd, bt, 0, 0, 20, 20);
54 bt = elm_button_add(win);
55 elm_button_label_set(bt, "Button");
56 elm_grid_pack(gd, bt, 10, 10, 40, 20);
59 bt = elm_button_add(win);
60 elm_button_label_set(bt, "Button");
61 elm_grid_pack(gd, bt, 10, 30, 20, 50);
64 bt = elm_button_add(win);
65 elm_button_label_set(bt, "Button");
66 elm_grid_pack(gd, bt, 80, 80, 20, 20);
69 bt = elm_button_add(win);
70 elm_button_label_set(bt, "Change");
71 elm_grid_pack(gd, bt, 40, 40, 20, 20);
72 evas_object_smart_callback_add(bt, "clicked", _ch_grid, gd);
75 rc = evas_object_rectangle_add(evas_object_evas_get(win));
76 evas_object_color_set(rc, 128, 0, 0, 128);
77 elm_grid_pack(gd, rc, 40, 70, 20, 10);
80 rc = evas_object_rectangle_add(evas_object_evas_get(win));
81 evas_object_color_set(rc, 0, 128, 0, 128);
82 elm_grid_pack(gd, rc, 60, 70, 10, 10);
85 rc = evas_object_rectangle_add(evas_object_evas_get(win));
86 evas_object_color_set(rc, 0, 0, 128, 128);
87 elm_grid_pack(gd, rc, 40, 80, 10, 10);
90 rc = evas_object_rectangle_add(evas_object_evas_get(win));
91 evas_object_color_set(rc, 128, 0, 128, 128);
92 elm_grid_pack(gd, rc, 50, 80, 10, 10);
95 rc = evas_object_rectangle_add(evas_object_evas_get(win));
96 evas_object_color_set(rc, 128, 64, 0, 128);
97 elm_grid_pack(gd, rc, 60, 80, 10, 10);
100 evas_object_resize(win, 480, 480);
101 evas_object_show(win);