Question
I'm trying to implement a click event handler for a Label widget in Tizen. Looking at the available properties in Tizen Studio, I only see these options:
- slide, end
- language, changed
Is it possible to handle click events on a Tizen Label? If so, how can I implement this functionality?
Answer
Problem Understanding
The user wants to detect click/tap events on a Label widget in Tizen. By default, Label widgets don't have obvious click event properties in Tizen Studio's UI Builder.
Solution Methods
-
Using Smart Callbacks:
- Labels support click events through the EFL (Enlightenment Foundation Libraries) smart callback system
- The correct signal name is "clicked" (not "anchor,clicked")
-
Implementation Steps:
- Add the event handler programmatically in your view_create callback
- Use the correct signal name "clicked"
Code Examples
// Adding click event handler programmatically
evas_object_smart_callback_add(your_label, "clicked",
(Evas_Smart_Cb)your_click_handler, your_data);
// Click handler function
void your_click_handler(your_context_type *data, Evas_Object *obj, void *event_info) {
dlog_print(DLOG_INFO, "TAG", "Label clicked");
// Your click handling code here
}
Additional Tips
- If using a custom EDC style, ensure it doesn't interfere with event handling
- Remember that the signal name is case-sensitive
- For more details, refer to the Tizen Native API documentation on Label widgets