[COTDC] 90 - TextAlignment

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

[COTDC] 90 - TextAlignment

Sean P. DeNigris
Administrator
Continuing in Collections...

Today:  TextAlignment


Comment Of The Day Contest - One Day One Comment
Rules:
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest

p.s. this message was sent from a pharo image. Did you know you could easily do that?!

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: [COTDC] 90 - TextAlignment

laurent laffont
On Thu, Dec 1, 2011 at 2:05 PM, <[hidden email]> wrote:
Continuing in Collections...

Today:  TextAlignment


I'm a Text attribute that tells how content should be aligned.

TextMorph new 
  newContents: (Text streamContents: [:aStream| 
aStream
nextPutAll: 'Left flush' asText; 
cr;
nextPutAll: ('Centered' asText addAttribute: TextAlignment centered); 
cr;
nextPutAll: ('Right flush' asText addAttribute: TextAlignment rightFlush); 
cr ]);
  openInWindowLabeled: 'TextAlignment demo'


Laurent




 

Comment Of The Day Contest - One Day One Comment
Rules:
#1: Each day a not commented class is elected. Each day the best comment will be integrated with name of the author(s).
#2: If you cannot comment it, deprecate it.
Results: http://code.google.com/p/pharo/wiki/CommentOfTheDayContest

p.s. this message was sent from a pharo image. Did you know you could easily do that?!