Important: The information in this document is obsolete and should not be used for new development.
The High Hook and Caret Hook Fields
ThehighHook
andcaretHook
fields--at the offsetsteHiHook
andteCarHook
in assembly language--contain the addresses of routines that deal with text highlighting and the caret. These routines pass parameters in registers; if you replace these routines, your application must save and restore the registers' contents.If you store the address of a routine in
teHiHook
, that routine is used instead of the QuickDraw procedureInvertRect
, which is called by default, whenever a selection range is to be highlighted. Your routine can destroy the contents of registers A0, A1, D0, D1, and D2. On entry, A3 is a pointer to a locked edit record; the stack contains the rectangle enclosing the text being highlighted. (Use of the A3 register is equivalent to theInvertRect
r
parameter of typeRECT
. See the QuickDraw chapters in Inside Macintosh: Imaging for more information about theInvertRect
procedure.) For example, if you store the address of the following routine inteHiHook
, selection range is underlined instead of inverted.
UnderHigh MOVE.L 4(SP),A0 ;get address of rectangle to be ;highlighted MOVE bottom(A0),top(A0) ;make the top coordinate equal to SUBQ #1,top(A0) ;the bottom coordinate minus 1 _InverRect ;invert the resulting rectangle RTSThe routine whose address is stored inteCarHook
acts exactly the same way as theteHiHook
routine, but on the caret instead of the selection range, allowing you to change the appearance of the caret. The routine is called with the stack containing the rectangle address that encloses the caret.