summaryrefslogtreecommitdiff
path: root/src/examples/genlist_example_03.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-03-06 06:30:43 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-03-06 06:30:43 +0000
commit1cb3372426f72f1ac11d4d2c0a66470cf0c0020a (patch)
treeb16d0482e471f03e15061c6fc217a1d805088b7a /src/examples/genlist_example_03.c
parentb4c9199056acf00924c4b3b37812b4e959080317 (diff)
lets update genlist/grid examples to use the new class thing.
SVN revision: 68774
Diffstat (limited to 'src/examples/genlist_example_03.c')
-rw-r--r--src/examples/genlist_example_03.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/examples/genlist_example_03.c b/src/examples/genlist_example_03.c
index 946fa840d..1f67c8c24 100644
--- a/src/examples/genlist_example_03.c
+++ b/src/examples/genlist_example_03.c
@@ -10,7 +10,7 @@
10 10
11#define N_ITEMS 30 11#define N_ITEMS 30
12 12
13static Elm_Genlist_Item_Class _itc; 13static Elm_Genlist_Item_Class *_itc = NULL;
14 14
15static char * 15static char *
16_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part) 16_item_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part)
@@ -71,7 +71,7 @@ _genlist_fill(Evas_Object *list)
71 71
72 for (i = 0; i < N_ITEMS; i++) 72 for (i = 0; i < N_ITEMS; i++)
73 { 73 {
74 elm_genlist_item_append(list, &_itc, 74 elm_genlist_item_append(list, _itc,
75 (void *)(long)i, NULL, 75 (void *)(long)i, NULL,
76 ELM_GENLIST_ITEM_NONE, 76 ELM_GENLIST_ITEM_NONE,
77 _item_sel_cb, NULL); 77 _item_sel_cb, NULL);
@@ -102,12 +102,16 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
102 elm_win_resize_object_add(win, box); 102 elm_win_resize_object_add(win, box);
103 evas_object_show(box); 103 evas_object_show(box);
104 104
105 _itc.item_style = "double_label"; 105 if (!_itc)
106 _itc.func.text_get = _item_label_get; 106 {
107 _itc.func.content_get = _item_content_get; 107 _itc = elm_genlist_item_class_new();
108 _itc.func.state_get = NULL; 108 _itc->item_style = "double_label";
109 _itc.func.del = NULL; 109 _itc->func.text_get = _item_label_get;
110 110 _itc->func.content_get = _item_content_get;
111 _itc->func.state_get = NULL;
112 _itc->func.del = NULL;
113 }
114
111 list = _genlist_add(box); 115 list = _genlist_add(box);
112 _genlist_fill(list); 116 _genlist_fill(list);
113 117