![]() |
TECustomHook |
||||
Header: | TextEdit.h | Carbon status: | Not Recommended | |
Replaces a default TextEdit hook function with a customized function and returns the address of the replaced function.
void TECustomHook ( TEIntHook which, UniversalProcPtr *addr, TEHandle hTE );
The hook whose default function is to be replaced.
On input, the address of your customized function.
On output, the addr parameter contains the address of the function that was previously installed in the field identified by the which parameter. This address is returned so that you can daisy-chain functions.
A handle to the edit structure to be modified.
The TECustomHook function lets you alter the behavior of TextEdit to better suit your applications requirements and those of the script systems installed. If you replace a default hook function with a customized version that you write in a high-level language, such as Pascal or C, you need to provide assembly-language glue code that utilizes the registers for your high-level language function.
The end-of-line hook, width measurement hook, new width measurement hook, text width measurement hook, draw hook, and hit test hook fields are hook fields in the TextEdit dispatch structure. The which parameter identifies the hook whose default function is to be replaced. You use the constants described in
Certain precautions are critical in replacing default functions. Before placing the address of your function in the TextEdit dispatch structure, strip the addresses, using the Operating System Utilities StripAddress function, to guarantee that your application is 32-bit clean.
Before replacing a TextEdit function with a customized one, determine whether more than one script system is installed, and if so, ensure that your customized function accommodates all of the installed script systems. This avoids the problem of your customized function producing results that are incompatible with the Script Manager.
Not recommended in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)