summaryrefslogtreecommitdiff
path: root/src/examples/gengrid_example.c
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2011-07-25 19:52:15 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2011-07-25 19:52:15 +0000
commitc124569c6ada6025bf78bbb6584f1224dfad05fd (patch)
treecf7f73ad1a3855ce6791ebf3cab40d4af9258240 /src/examples/gengrid_example.c
parent054f54a4dda35e08db946abf4f3c18be517aa3eb (diff)
[elementary] Documenting/exemplifying the following:
- elm_gengrid_item_append - elm_gengrid_item_prepend - elm_gengrid_item_bring_in - elm_gengrid_item_show - elm_gengrid_item_insert_after - elm_gengrid_item_insert_before - elm_gengrid_item_size_get - elm_gengrid_item_size_set - elm_gengrid_selected_item_get - elm_gengrid_selected_items_get - elm_gengrid_first_item_get - elm_gengrid_last_item_get SVN revision: 61705
Diffstat (limited to 'src/examples/gengrid_example.c')
-rw-r--r--src/examples/gengrid_example.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/examples/gengrid_example.c b/src/examples/gengrid_example.c
index 7e22e9515..705a0cef3 100644
--- a/src/examples/gengrid_example.c
+++ b/src/examples/gengrid_example.c
@@ -222,6 +222,32 @@ _clear_cb(void *data,
222 fprintf(stdout, "Clearing the grid!\n"); 222 fprintf(stdout, "Clearing the grid!\n");
223} 223}
224 224
225/* bring in 1st item */
226static void
227_bring_1st_clicked(void *data,
228 Evas_Object *obj __UNUSED__,
229 void *event_info __UNUSED__)
230{
231 Elm_Gengrid_Item *it = elm_gengrid_first_item_get(data);
232
233 if (!it) return;
234
235 elm_gengrid_item_bring_in(it);
236}
237
238/* show last item */
239static void
240_show_last_clicked(void *data,
241 Evas_Object *obj __UNUSED__,
242 void *event_info __UNUSED__)
243{
244 Elm_Gengrid_Item *it = elm_gengrid_last_item_get(data);
245
246 if (!it) return;
247
248 elm_gengrid_item_show(it);
249}
250
225/* change items' size */ 251/* change items' size */
226static void 252static void
227_size_changed(void *data, 253_size_changed(void *data,
@@ -422,6 +448,18 @@ elm_main(int argc __UNUSED__,
422 elm_box_pack_end(hbx_1, bt); 448 elm_box_pack_end(hbx_1, bt);
423 evas_object_show(bt); 449 evas_object_show(bt);
424 450
451 bt = elm_button_add(win);
452 elm_object_text_set(bt, "Bring in 1st");
453 evas_object_smart_callback_add(bt, "clicked", _bring_1st_clicked, grid);
454 elm_box_pack_end(hbx_1, bt);
455 evas_object_show(bt);
456
457 bt = elm_button_add(win);
458 elm_object_text_set(bt, "Show last");
459 evas_object_smart_callback_add(bt, "clicked", _show_last_clicked, grid);
460 elm_box_pack_end(hbx_1, bt);
461 evas_object_show(bt);
462
425 sp = elm_spinner_add(win); 463 sp = elm_spinner_add(win);
426 elm_spinner_min_max_set(sp, 10, 1024); 464 elm_spinner_min_max_set(sp, 10, 1024);
427 elm_spinner_value_set(sp, 150); 465 elm_spinner_value_set(sp, 150);