언어 설정

Menu
Sites
Language
Gestures on box

Hi,

I have a box, which has 1 label in the middle of the screen.

I create a gesture, setup the callback, attach to the box, but the callback is only called when I touch on the label.

If I click other area of the box, the gesture callback is not called.

    ad->box = elm_box_add(ad->conform);
    evas_object_size_hint_weight_set(ad->box,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND);
    elm_object_content_set(ad->conform,ad->box);
    evas_object_show(ad->box);

    ad->label = elm_label_add(ad->conform);
    elm_object_text_set(ad->label, "xxxxxxxxxxxxxxxxxxxx");
    evas_object_size_hint_align_set(ad->label,0.5,0.5);
    evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(ad->label);
    elm_box_pack_end(ad->box,ad->label);

    Evas_Object *gesture = elm_gesture_layer_add(ad->win);
    elm_gesture_layer_attach(gesture, ad->box);
    elm_gesture_layer_cb_set(gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, n_finger_tap_start,  NULL);


What I want, is to be able to catch the gestures on fullscreen.

But if I add a rectangle to the box, it will not cover the full box area, only comes after the label.

But anyway, can't I catch the gesture on the box-fullscreen area? (or maybe my box is not fullscreen?)

Responses

1 댓글
Zoltan Puski

If I don't use Gesture, but this:

evas_object_event_callback_add(ad->box, EVAS_CALLBACK_MOUSE_DOWN, callback_func, ad);

It behaves the same, callback is only called when you click on the box at position where it has a control inside, not any "empty" area.

.

However, I could make it work with Rectangle:

    Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(ad->win));
    evas_object_move(rect, 0, 0);
    evas_object_color_set(rect, 0, 0, 0, 0);
    elm_win_resize_object_add(ad->win, rect);

    Evas_Object *gesture = elm_gesture_layer_add(ad->win);
    elm_gesture_layer_attach(gesture, rect);
    elm_gesture_layer_cb_set(gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, n_finger_tap_start,  NULL);
    evas_object_show(rect);