summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2016-07-01 21:23:41 -0300
committerVitor Sousa <vitorsousasilva@gmail.com>2016-07-05 14:13:03 -0300
commita856b2d8ce1db558c3cf50b42703327f7df4db77 (patch)
tree776cb080942f5f74ff898902f408aaa996045623
parentf04ff73deac25bea7e025249214cbfc5abffd7fe (diff)
examples: added efl_ui_image_factory in layout_model_connect example
-rw-r--r--src/examples/elementary/layout_model_connect.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/examples/elementary/layout_model_connect.c b/src/examples/elementary/layout_model_connect.c
index 5cfd43c396..a1baa3f68f 100644
--- a/src/examples/elementary/layout_model_connect.c
+++ b/src/examples/elementary/layout_model_connect.c
@@ -21,6 +21,7 @@ struct _Layout_Model_Data
21 Eo *model; 21 Eo *model;
22 Evas_Object *label; 22 Evas_Object *label;
23 Evas_Object *entry; 23 Evas_Object *entry;
24 Evas_Object *img;
24}; 25};
25typedef struct _Layout_Model_Data Layout_Model_Data; 26typedef struct _Layout_Model_Data Layout_Model_Data;
26 27
@@ -41,6 +42,7 @@ _list_selected_cb(void *data EINA_UNUSED, const Eo_Event *event)
41 printf("LIST selected model\n"); 42 printf("LIST selected model\n");
42 efl_ui_view_model_set(priv->label, child); 43 efl_ui_view_model_set(priv->label, child);
43 efl_ui_view_model_set(priv->entry, child); 44 efl_ui_view_model_set(priv->entry, child);
45 efl_ui_view_model_set(priv->img, child);
44} 46}
45 47
46 48
@@ -80,6 +82,7 @@ elm_main(int argc, char **argv)
80{ 82{
81 Layout_Model_Data *priv; 83 Layout_Model_Data *priv;
82 Evas_Object *win, *panes, *bxr, *genlist, *bt; 84 Evas_Object *win, *panes, *bxr, *genlist, *bt;
85 Eo *img_factory;
83 char *dirname; 86 char *dirname;
84 87
85 priv = alloca(sizeof(Layout_Model_Data)); 88 priv = alloca(sizeof(Layout_Model_Data));
@@ -134,6 +137,16 @@ elm_main(int argc, char **argv)
134 evas_object_smart_callback_add(bt, "clicked", _update_cb, priv); 137 evas_object_smart_callback_add(bt, "clicked", _update_cb, priv);
135 evas_object_show(bt); 138 evas_object_show(bt);
136 139
140 /* Image widget */
141 img_factory = eo_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
142 efl_ui_model_connect(img_factory, "", "path"); //connect to "path" property
143
144 priv->img = efl_ui_factory_create(img_factory, NULL);
145 elm_box_pack_end(bxr, priv->img);
146 evas_object_size_hint_weight_set(priv->img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
147 evas_object_size_hint_align_set(priv->img, EVAS_HINT_FILL, EVAS_HINT_FILL);
148 evas_object_show(priv->img);
149
137 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, priv); 150 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, priv);
138 //showall 151 //showall
139 evas_object_resize(win, 800, 400); 152 evas_object_resize(win, 800, 400);