Squeak Class Documentation category index | class index  
 
TextAnchor
  category: Morphic-Text Support
  superclass: TextAttribute
  subclasses: TextAnchorPlus

TextAnchors support anchoring of images in text. A TextAnchor exists as an attribute of text emphasis, and it gets control like a FontReference, through the emphasizeScanner: message. Depending on whether its anchoredMorph is a Morph or a Form, it repositions the morph, or displays the form respectively. The coordination between composition, display and selection can best be understood by browsing the various implementations of placeEmbeddedObject:.

In the morphic world, simply embed any morph in text. In the old world, you can create an image reference using code such as the following.
ParagraphEditor new clipboardTextPut:
(Text string: '*'
attribute: (TextAnchor new anchoredMorph: Form fromUser))
In this case you select a piece of the screen, and it gets anchored to a one-character text in the editor's past buffer. If you then paste into some other text, you will see the image as an embedded image.

instance methods
  as yet unclassified
  =
anchoredMorph
anchoredMorph:
couldDeriveFromPrettyPrinting
emphasizeScanner:
mayBeExtended

class methods
  no messages
 

instance methods
  as yet unclassified top  
 

=

Answer whether the receiver and the argument represent the same
object. If = is redefined in any subclass, consider also redefining the
message hash.


 

anchoredMorph


 

anchoredMorph:


 

couldDeriveFromPrettyPrinting

Answer whether the receiver is a kind of attribute that could have been generated by doing polychrome pretty-printing of a method without functional text attributes.


 

emphasizeScanner:

Subclasses may override to set, eg, font, color, etc


 

mayBeExtended

A textAnchor is designed to modify only a single character, and therefore must not be extended by the ParagraphEditor's emphasisHere facility


class methods
  no messages top