Logo

18.5.3 Text presentation

A TextPresentation offers the possibility to display a text in an editor. For example, suppose we have a class at hand, we can display the source code in the following way:

browser transmit to: #source; andShow: [ :a |
a text
display: [ :class | class sourceText ] ].

The presentation offers control over the setting and retrieving the currently selected text. The selected text is provided via the port named #selectedText. It is not provided through the #selection port, because in most cases, it is not text that we want as an abstraction to pass forward to other ports. Furthermore, we can also set the currently selected text through the #selectionInterval port.

User Contributed Notes

tudor (27 April 2011, 4:44 pm)

Thanks. I added a note

stephan (22 April 2011, 1:31 pm)

The description of forSmalltalk: is not clear.

Add a Note