Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007563 [Squeak] Documentation major always 09-12-10 02:37 09-12-10 21:24
Reporter casey View Status public  
Assigned To casey
Priority high Resolution open  
Status assigned   Product Version trunk
Summary 0007563: TextStream needs a class comment
Description The following comment is useless:

"A TextStream is xxxxxxxxx.

Instance Variables
"
Additional Information
Attached Files

- Relationships

- Notes
(0013876 - 1646 - 2762 - 2876 - 2876 - 2876 - 2876)
hirzel
09-12-10 21:24

Source: http://wiki.squeak.org/squeak/29 [^]
The following example shows how to use class TextStream.
It was posted to the Squeak list by Boris Gaertner on 5-Jan-03.

  | ts |
  ts := TextStream on: (Text new: 100).
  ts nextPutAll: 'Class ';
     withAttribute: TextEmphasis bold
          do: [ts nextPutAll: 'TextStream'];
          cr.
  ts nextPutAll: 'This class is used to create ';
     withAttributes: (Set with: TextEmphasis bold with: TextEmphasis underlined)
          do: [ts nextPutAll: 'styled text.'];
          cr;
     withAttribute: TextEmphasis italic
          do: [ts nextPutAll: 'Styled text'];
     withAttribute: TextEmphasis normal
          do: [ts nextPutAll: ' has display properties like '];
     withAttribute: TextEmphasis bold
          do: [ts nextPutAll: 'bold '];
     withAttribute: TextEmphasis italic
          do: [ts nextPutAll: 'italic '];
     withAttribute: TextEmphasis struckOut
          do: [ts nextPutAll: 'struck out '];
     cr.
 (Workspace new contents: ts contents)
         openLabel: 'TextStreams are powerful'


--------------
Another example was posted by Boris Gaertner 5-Jul-03

Create a text with a hyperlink in it:

 | ts |
  ts := TextStream on: (Text new).
  ts nextPutAll: 'Squeak is a beautiful language. Look at '.
  ts withAttribute: (TextURL new url: 'http:\\www.squeak.org')
     do:
      [ ts nextPutAll: 'http:\\www.squeak.org'].
  ts nextPutAll: ' to learn more about it.'.
(Workspace new contents: ts contents) openLabel: 'Here is your Hyperlink:'


----------------

To do: check if the examples still work and if not adapt them.
 

- Issue History
Date Modified Username Field Change
09-12-10 02:37 casey New Issue
09-12-10 02:37 casey Status new => assigned
09-12-10 02:37 casey Assigned To  => casey
09-12-10 21:24 hirzel Note Added: 0013876


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
34 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker