Important: The information in this document is obsolete and should not be used for new development.
 
  
  
  
 
InitCursorCtl
To load the resources necessary for displaying an animated cursor, use theInitCursorCtlprocedure.
PROCEDURE InitCursorCtl (newCursors: UNIV acurHandle);
newCursors
A handle to anAcurrecord (described on page 8-18) that specifies the cursor resources you want to use in your animation. If you specifyNILin this parameter,InitCursorCtlloads the animated cursor resource (described on page 8-33) with resource ID 0--as well as the cursor resources (described on page 8-31) specified therein--from your application's resource file.DESCRIPTION
TheInitCursorCtlprocedure loads the cursor resources for an animated cursor sequence into memory. Your application should call theInitCursorCtlprocedure once prior to calling theRotateCursorprocedure (described on page 8-30) or theSpinCursorprocedure (described on page 8-30).If your application passes
NILin thenewCursorsparameter,InitCursorCtlloads the'acur'resource with resource ID 0, as well as the'CURS'resources whose resource IDs are specified in the'acur'resource. If any of the resources cannot be loaded, the cursor does not change when you callRotateCursororSpinCursor. Otherwise, theRotateCursorprocedure and theSpinCursorprocedure display in sequence the cursors specified in these resources.If your application does not pass
NILin thenewCursorsparameter, it must pass a handle to anAcurrecord. Your application can use the Resource Manager functionGetResourceto obtain a handle to an'acur'resource, which your application should then coerce to a handle of typeacurHandlewhen passing it toInitCursorCtl.If your application calls the
RotateCursororSpinCursorprocedure without callingInitCursorCtl,RotateCursorandSpinCursorautomatically callInitCursorCtl. However, since you won't know the state of memory, any memory allocated by the Resource Manager for animating cursors may load into an undesirable location, possibly causing fragmentation. Calling theInitCursorCtlprocedure during your initialization process has the advantage of causing the memory allocation when you can control its location. For information on using theInitCursorCtlprocedure during your initialization process, see "Initializing the Cursor" on page 8-6.SPECIAL CONSIDERATION
If you want to use multiple'acur'resources repeatedly during the execution of your application, be aware that theInitCursorCtlprocedure changes eachframeNandfillNinteger pair within theAcurrecord in memory to a handle to the corresponding'CURS'resource, which is also in memory. Thus, if thenewCursorsparameter is notNILwhen your application calls theInitCursorCtlprocedure, your application must guarantee thatnewCursorsalways points to a fresh copy of an'acur'resource.SEE ALSO
Listing 8-1 on page 8-6 illustrates how to initialize an animated cursor by using theInitCursorCtlprocedure. Listing 8-3 on page 8-13 shows how to animate the cursor with theRotateCursorprocedure, and Listing 8-4 on page 8-13 shows how to animate the cursor with theSpinCursorprocedure.
 
  
  
 