Callbacks for anchors do not work in label

Callbacks for anchors do not work in label

BY 31 Aug 2015 Native Application Development

Hi,

Callbacks for anchors do not work in label on SDK 2.4 and Z3 phone. I created label, add smart callback for “anchor,clicked” and “clicked”, but these callbacks are not invoked.

This code works good on Z1 phone: all callbacks are called well.

Code example is below based on standard sample application: BasicUIApplication. 
Could you please advice what is wrong in my code and how it can be fixed?

static void
create_base_gui(appdata_s *ad)
{

    /* Label*/
    ad->label = elm_label_add(ad->conform);
    evas_object_smart_callback_add(ad->label, “anchor,clicked”, on_anchor_clicked_cb, NULL);
    evas_object_smart_callback_add(ad->label, “clicked”, on_clicked_cb, NULL);

    elm_object_text_set(ad->label, “<align=center>Hello EFL</align> <br/> <br/> <a href=s_link_href>This is link</a>”);
    evas_object_size_hint_weight_set(ad->label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    elm_object_content_set(ad->conform, ad->label);


    /* Show window after base gui is set up */
    evas_object_show(ad->win);
}

 

static void on_anchor_clicked_cb(void *user_data, Evas_Object *obj, void *event_info)
{
    dlog_print(DLOG_INFO, “Test_app”, “on_anchor_clicked_cb”);
    Elm_Label_Anchor_Info *event = (Elm_Label_Anchor_Info*)(event_info);
    if(event) {
        dlog_print(DLOG_INFO, “Test_app”, “Elm_Label_Anchor_Info, Name: %s\n”,
                event->name);
    }
}

static void on_clicked_cb(void *user_data, Evas_Object *obj, void *event_info)
{
    dlog_print(DLOG_INFO, “Test_app”, “on_clicked_cb”);
}

 

Thank you in advance,

Dmitry

Written by