How to wrap text in labels?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to wrap text in labels?

Tommaso DS
Hello everybody,

I was wondering, is there a way to wrap text inside a Morphic/Bloc label?
I am building a list of text elements, but I am not able to wrap the
text to match the width of the widget.

For the moment I solved the issue by instantiating a Rubric text area
for each text element, but it becomes much more resource expensive and
slower.

Is there a better widget to manage that?

Thanks,
Tommaso


Reply | Threaded
Open this post in threaded view
|

Re: How to wrap text in labels?

Nicolai Hess-3-2


2016-08-08 12:27 GMT+02:00 Tommaso Dal Sasso <[hidden email]>:
Hello everybody,

I was wondering, is there a way to wrap text inside a Morphic/Bloc label?
I am building a list of text elements, but I am not able to wrap the text to match the width of the widget.

For the moment I solved the issue by instantiating a Rubric text area for each text element, but it becomes much more resource expensive and slower.

Is there a better widget to manage that?

Thanks,
Tommaso


Hi Tommaso,

can you use a TextMorph with a panel or an other morph for the background, and set the full owners shape and wrap-flag ?
I think the default label widgets (StringMorph/LabelMorph) do not support text wrapping.

Morph new color: Color white; addMorph:(TextMorph new contents:'Hello World Hello World Hello World';wrapFlag:true;fillsOwner:true;yourself);openInHand.

 

Reply | Threaded
Open this post in threaded view
|

Re: How to wrap text in labels?

Tommaso DS
On 08/08/16 13:04, Nicolai Hess wrote:


2016-08-08 12:27 GMT+02:00 Tommaso Dal Sasso <[hidden email]>:
Hello everybody,

I was wondering, is there a way to wrap text inside a Morphic/Bloc label?
I am building a list of text elements, but I am not able to wrap the text to match the width of the widget.

For the moment I solved the issue by instantiating a Rubric text area for each text element, but it becomes much more resource expensive and slower.

Is there a better widget to manage that?

Thanks,
Tommaso


Hi Tommaso,

can you use a TextMorph with a panel or an other morph for the background, and set the full owners shape and wrap-flag ?
I think the default label widgets (StringMorph/LabelMorph) do not support text wrapping.

Morph new color: Color white; addMorph:(TextMorph new contents:'Hello World Hello World Hello World';wrapFlag:true;fillsOwner:true;yourself);openInHand.

Thanks a lot, your example was what I was looking for. I'll try this way.

Cheers,
Tommaso