Languages

Menu
Sites
Language
Click/tap on label

Hi All, 

I want to know if is possible, to fire a click event on a label, looking at the properties it looks like that it is not supported. In tizen studio the only available options are: 

  • slide, end
  • language, changed

Do anyone know if it is possible to handle a click event on a Tizen Label?

Responses

4 Replies
Yasin Ali

Hi,

Check out this link: https://developer.tizen.org/development/guides/native-application/user-interface/efl/ui-components/mobile-ui-components/label

Table: Label callback signals
Signal:      anchor,clicked
Description: The anchor is clicked.
event_info:  Elm_Label_Anchor_Info object

Label widget inherits from the Layout
( link : https://developer.tizen.org/development/api-references/native-application?redirect=/dev-guide/4.0.0/org.tizen.native.mobile.apireference/group__Elm__Layout.html )
so that all the functions acting on it also work for label objects.

Hope it will help you.
If you find my post is helpful for you, please mark it as answer to promote this post to others.

Ivan Gualandri

So to use that, in the layout.xml i should add a line similar to: 

<event function_name="game_view_player2_energy_counter_onclick"
    					signal="anchor,clicked" />

 

Ivan Gualandri

Ok so: 

The event on xml is not working (it's not recognized by the ui builder). 

So i tried to add the event manually in the view_create callback, this is the line that i added: 

evas_object_smart_callback_add(vc->player2_energy_counter, "anchor,clicked", (Evas_Smart_Cb)game_view_player2_energy_anchor_onclicked, vc);

Where player2 energy counter is a label created using UI Builder.

Then the event callback: 

void game_view_player2_energy_anchor_onclicked(uib_game_view_view_context *vc, Evas_Object *obj, void *event_info) {
//
    dlog_print(DLOG_INFO, "MyTag", "Called");
}

But for some reason the click is not working. 

Anyway i forgot to mention that for the label i'm using a custom edc style.

Ivan Gualandri

So the problem was the name of the event fired. Instead of "anchor,clicked", it has to be just "clicked". Doing that it started working.