tizentizen-wearable-sdktizen-native-app

How to get entry text without elm attributes on Tizen?


I am setting text on entry box on Tizen watch but because of it being too big to fit on screen I'm using smaller font size with <font_size> attribute. But after editing when I get the text back it returns me with those attributes as well.

I have thought of making string operation to remove those html tags/ elm attributes. But after editing entry box will add those added text after those elm attributes.

for example: entry_text_set(entry, "<font_size=15>Hello,This is our text.</font_size>"); will return same text including attributes for elm_object_text_get(entry); Now string operation is good if those tags are at the end since we will have to do more character mathcing operation if those are in between other texts. Now after adding hello on entry box it returns this : <font_size=15>Hello,This is our text.</font_size>Hello .

How can I get text without <font_size>/any such attributes?


Solution

  • About the question of "How can I get text without /any such attributes?".

    You can use elm_entry_markup_to_utf8(const char *s). This API would remove all the markup tags from your string. But, you need to keep in mind that the utf8 text should be converted back to markup text before inserting to elm_entry. (you can use elm_entry_utf8_to_markup).

    I hope my answer would be helpful.