On Fri, Sep 9, 2011 at 4:18 PM, Benjamin Drucker <benjamin.t.drucker@alum.mit.edu> wrote:
> gengrid already emits "longpressed" signals, but it is not currently
> documented nor demonstrated in the examples. See the attached patch,
> please.
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@63323
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
fprintf(stdout, "Double click on item with handle %p\n", event_info);
}
+/* item long press callback */
+static void
+_long_pressed(void *data __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info)
+{
+ fprintf(stdout, "Long press on item with handle %p\n", event_info);
+}
+
+
/* label fetching callback */
static char *
_grid_label_get(void *data,
evas_object_size_hint_min_set(grid, 600, 500);
elm_box_pack_end(bx, grid);
evas_object_smart_callback_add(grid, "clicked,double", _double_click, NULL);
+ evas_object_smart_callback_add(grid, "longpressed", _long_pressed, NULL);
evas_object_show(grid);
hbx_1 = elm_box_add(win);
* is the gengrid item that was activated.
* - @c "clicked,double" - The user has double-clicked an item.
* The @c event_info parameter is the gengrid item that was double-clicked.
+ * - @c "longpressed" - This is called when the item is pressed for a certain
+ * amount of time. By default it's 1 second.
* - @c "selected" - The user has made an item selected. The
* @c event_info parameter is the gengrid item that was selected.
* - @c "unselected" - The user has made an item unselected. The
static const char SIG_ACTIVATED[] = "activated";
static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
+static const char SIG_LONGPRESSED[] = "longpressed";
static const char SIG_SELECTED[] = "selected";
static const char SIG_UNSELECTED[] = "unselected";
static const char SIG_REALIZED[] = "realized";
static const Evas_Smart_Cb_Description _signals[] = {
{SIG_ACTIVATED, ""},
{SIG_CLICKED_DOUBLE, ""},
+ {SIG_LONGPRESSED, ""},
{SIG_SELECTED, ""},
{SIG_UNSELECTED, ""},
{SIG_REALIZED, ""},
item->long_timer = NULL;
if ((item->disabled) || (item->dragging)) return ECORE_CALLBACK_CANCEL;
item->wd->longpressed = EINA_TRUE;
- evas_object_smart_callback_call(item->wd->self, "longpressed", item);
+ evas_object_smart_callback_call(item->wd->self, SIG_LONGPRESSED, item);
if (item->wd->reorder_mode)
{
item->wd->reorder_item = item;