aboutsummaryrefslogtreecommitdiffstats
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
parentelementary: add efl_ui_image_factory (diff)
downloadefl-a856b2d8ce1db558c3cf50b42703327f7df4db77.tar.gz
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
Eo *model;
Evas_Object *label;
Evas_Object *entry;
+ Evas_Object *img;
};
typedef struct _Layout_Model_Data Layout_Model_Data;
@@ -41,6 +42,7 @@ _list_selected_cb(void *data EINA_UNUSED, const Eo_Event *event)
printf("LIST selected model\n");
efl_ui_view_model_set(priv->label, child);
efl_ui_view_model_set(priv->entry, child);
+ efl_ui_view_model_set(priv->img, child);
}
@@ -80,6 +82,7 @@ elm_main(int argc, char **argv)
{
Layout_Model_Data *priv;
Evas_Object *win, *panes, *bxr, *genlist, *bt;
+ Eo *img_factory;
char *dirname;
priv = alloca(sizeof(Layout_Model_Data));
@@ -134,6 +137,16 @@ elm_main(int argc, char **argv)
evas_object_smart_callback_add(bt, "clicked", _update_cb, priv);
evas_object_show(bt);
+ /* Image widget */
+ img_factory = eo_add(EFL_UI_IMAGE_FACTORY_CLASS, win);
+ efl_ui_model_connect(img_factory, "", "path"); //connect to "path" property
+
+ priv->img = efl_ui_factory_create(img_factory, NULL);
+ elm_box_pack_end(bxr, priv->img);
+ evas_object_size_hint_weight_set(priv->img, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(priv->img, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(priv->img);
+
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _cleanup_cb, priv);
//showall
evas_object_resize(win, 800, 400);