summaryrefslogtreecommitdiff
path: root/src/examples/gengrid_example.c
diff options
context:
space:
mode:
authorGustavo Lima Chaves <glima@profusion.mobi>2011-07-25 19:52:31 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2011-07-25 19:52:31 +0000
commitd23d9bfe8d889bf1f0774796edf48919e815bfd2 (patch)
tree2bd3ed70f4ffd16549db4704cf2a3ca743c57c94 /src/examples/gengrid_example.c
parentc124569c6ada6025bf78bbb6584f1224dfad05fd (diff)
[elementary] Documenting the following:
- elm_gengrid_item_cursor_engine_only_get - elm_gengrid_item_cursor_engine_only_set - elm_gengrid_item_cursor_get - elm_gengrid_item_cursor_set - elm_gengrid_item_cursor_style_get - elm_gengrid_item_cursor_style_set - elm_gengrid_item_cursor_unset - elm_gengrid_item_data_get - elm_gengrid_item_data_set - elm_gengrid_item_del - elm_gengrid_item_disabled_get - elm_gengrid_item_disabled_set - elm_gengrid_item_gengrid_get - elm_gengrid_item_next_get - elm_gengrid_item_object_get - elm_gengrid_item_pos_get - elm_gengrid_item_prev_get - elm_gengrid_item_selected_get - elm_gengrid_item_selected_set - elm_gengrid_item_tooltip_content_cb_set - elm_gengrid_item_tooltip_style_get - elm_gengrid_item_tooltip_style_set - elm_gengrid_item_tooltip_text_set - elm_gengrid_item_tooltip_unset - elm_gengrid_item_update SVN revision: 61706
Diffstat (limited to 'src/examples/gengrid_example.c')
-rw-r--r--src/examples/gengrid_example.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/examples/gengrid_example.c b/src/examples/gengrid_example.c
index 705a0cef3..bba0f7066 100644
--- a/src/examples/gengrid_example.c
+++ b/src/examples/gengrid_example.c
@@ -134,8 +134,13 @@ _grid_sel(void *data,
134 Evas_Object *obj __UNUSED__, 134 Evas_Object *obj __UNUSED__,
135 void *event_info) 135 void *event_info)
136{ 136{
137 fprintf(stdout, "Item [%p], with data [%p], has been selected\n", 137 unsigned int x, y;
138 event_info, data); 138 Example_Item *it = elm_gengrid_item_data_get(event_info);
139
140 elm_gengrid_item_pos_get(event_info, &x, &y);
141
142 fprintf(stdout, "Item [%p], with data [%p], path %s, at position (%d, %d),"
143 " has been selected\n", event_info, data, it->path, x, y);
139} 144}
140 145
141/* new item with random path */ 146/* new item with random path */
@@ -248,6 +253,20 @@ _show_last_clicked(void *data,
248 elm_gengrid_item_show(it); 253 elm_gengrid_item_show(it);
249} 254}
250 255
256/* disable selected item */
257static void
258_toggle_disabled_cb(void *data,
259 Evas_Object *obj __UNUSED__,
260 void *event_info __UNUSED__)
261{
262 Elm_Gengrid_Item *it = elm_gengrid_selected_item_get(data);
263
264 if (!it) return;
265
266 elm_gengrid_item_selected_set(it, EINA_FALSE);
267 elm_gengrid_item_disabled_set(it, EINA_TRUE);
268}
269
251/* change items' size */ 270/* change items' size */
252static void 271static void
253_size_changed(void *data, 272_size_changed(void *data,
@@ -475,6 +494,12 @@ elm_main(int argc __UNUSED__,
475 elm_box_pack_end(bx, hbx_2); 494 elm_box_pack_end(bx, hbx_2);
476 evas_object_show(hbx_2); 495 evas_object_show(hbx_2);
477 496
497 bt = elm_button_add(win);
498 elm_object_text_set(bt, "Disable item");
499 evas_object_smart_callback_add(bt, "clicked", _toggle_disabled_cb, grid);
500 elm_box_pack_end(hbx_2, bt);
501 evas_object_show(bt);
502
478 ck = elm_check_add(win); 503 ck = elm_check_add(win);
479 elm_object_text_set(ck, "Horizontal mode"); 504 elm_object_text_set(ck, "Horizontal mode");
480 evas_object_smart_callback_add(ck, "changed", _horizontal_grid, grid); 505 evas_object_smart_callback_add(ck, "changed", _horizontal_grid, grid);