语言

Menu
Sites
Language
Problems with Entry widget.

Hello,

I am trying to use Entry widget. I need non-editable single line text with ellipses at the end in case if text is longer than needed. Is it possible to implement this with Entry? I don’t want to use label widget.

 elm_entry_single_line_set(my_entry, EINA_TRUE);

 elm_entry_editable_set(my_entry, EINA_FALSE);

evas_object_size_hint_max_set(my_entry, 200, 64);

I faced the following problems with the Entry widget:

1. If text is too long then the Entry grows infinitely.

Is it possible to make it fix-sized and show ellipses at the end if text is too long?

2. I tried to set up its style:

char *user_style = "DEFAULT='font=Tizen:style=Regular font_size=15 ellipsis=1.0'";

elm_entry_text_style_user_push(my_entry, user_style);

I tried different styles, but it seems that this function doesn’t work at all. Nothing was changed.

Can anybody guide me how to avoid the issues above?

Thanks!

响应

6 回复
colin Rao

Hi,

for non-editable entry, you can callelm_entry_editable_set().

but for long text with ellipses, I dont face such possible for entry widget.

pius lee

for first problem.

use elm_entry_scrollable_set() it makes entry to fixed size.

but it can not show ellipsis, I think editable entry can't show ellipsis too.

Eric Satkimbaev

Thanks!

I don't need scrollable entry. But is it possible to restrict its size? It looks like a bug that we can't control size of the Entry widget at all.

Palitsyna

Hello,

you can find information about entry here, hope this will help you:

https://developer.tizen.org/dev-guide/2.3.0/org.tizen.native.mobile.apireference/group__Entry.html

Alex Dem

Hi,
I did not find possibility to restrict end of the text with ellipsis within single line entry too.
I was able to set  hard-sizes of 'entry widget' only with elm_entry_scrollable_set(ad->entry, EINA_TRUE);
Alexey.

Carsten Haitzler

you can control entry size, but you will have to manually resize it yourself. evas_object_move(entry, x, y), evasobject_resize(entry, w, h).

if the entry is resized to be smaller by its container... then it will work.

http://www.enlightenment.org/ss/e-55b06a2cea9455.14924250.png

http://www.enlightenment.org/ss/e-55b06a4e798e32.42947168.png

http://www.enlightenment.org/ss/e-55b06a7236fbe5.55769225.png

http://www.enlightenment.org/ss/e-55b06a93480c64.64475594.png

this is with a very simple:

   elm_entry_text_style_user_push (en, "DEFAULT='ellipsis=1.0'");

before setting any text. notice that the window is manually resized down, the text first starts wrapping, then starts elipsis-ing at the end and finally in the single line case. that's an elm entry without it being scrolled.