TEStylInsert
TEStylInsert
Insert text and style information into an edit record Ptr text ; address of an array of characters long length ; length, in bytes, of text to insert
StScrpHandle hStScrap ; handle of style info to apply (or 0) then applies style-formatting information to the inserted text and redraws it.
text is the address of an array of characters to insert.
length is the amount of text, in characters, to be copied from text to the
edit record.
hStScrap is a handle to a variable-length StScrpRec. This handle may be obtained via GetStylScrap or it may be 0. If hStScrap is 0, or if hTE is an old-format edit record, the style at the current insertion
point (or the first character of the current selection range) is
applied to the inserted text.
hTE is a handle obtained via TENew (old style TextEdit record) or TEStylNew (new style TextEdit record). It leads to a variable-length TERec structure and identifies the edit record to be affected by this change.
old-format edit records, or when hStScrap =0, it functions identically to
Make sure the text record that hTE points to is active before you call
With edit records created via TEStylNew, this function this also modifies elements of the TEStyleRec to account for the inserted text. When hStScrap is not 0, the text-formatting information in it is applied to the inserted
text.
Note that unlike TEPaste and TEKey, this does not replace the current selection range. The selection range remains selected and highlighted and
the text is inserted in front of it.