Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 2 - TextEdit / TextEdit Reference
Data Structures


The Style Scrap Record

The style scrap is used for storing character attribute information associated with the current text selection or insertion point, character attribute information to be applied to text, or multistyled text that is cut or copied. When multistyled text is cut or copied, the character attribute information is written to both the style scrap and the desk scrap.

In most cases, the style scrap is created dynamically as needed by routines. However, a style scrap record can be created directly without using the TEGetStyleScrapHandle function; the character attribute information written to it can be applied to inserted text through TEStyleInsert or to existing text through TEUseStyleScrap.

The format of the style scrap is defined by a style scrap record of type STScrpRec.

TYPE  StScrpRec = 
      RECORD
         scrpNStyles:   Integer;  {number of sets of }
                                  { character attributes in scrap}
         scrpStyleTab:  ScrpSTTable; {table of attributes for }
                                     { scrap}
      END;

StScrpPtr = ^StScrpRec;
StScrpHandle = ^StScrpPtr;
Field Description
scrpNStyles
The number of style runs used in the text. This determines the size of the style table. When character attribute information is written to the null scrap, this field is set to 1; when the character attribute information is removed, this field is set to 0.
scrpStyleTab
The scrap style table containing an element for each style run.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996