SetCursor
SetCursor Change the shape of the mouse cursor CursPtr newCursor; address of a 68-byte Cursor structure SetCursor installs a new cursor (i.e., mouse pointer) shape. If the cursor is currently hidden, it remains hidden until uncovered.
newCursor is the address of a Cursor structure . It contains the data defining the desired new cursor shape. You will typically obtain this value from a
resource, or use &arrow, the normal, left-leaning-arrow cursor.
Notes: Use the SetCursor function to change the cursor shape in response to mouse events; especially movement of the mouse over selected regions of a
window. When the mouse is in a text-editing area, the system- defined
iBeamCursor is appropriate; when accessing the disk, use the
resource file. Use SetCursor(&arrow) to set the cursor to the standard, "left-leaning" arrow shape.
If the cursor is currently hidden or temporarily turned off (HideCursor hidden until it is uncovered by ShowCursor or any mouse movement. Example
#include <Quickdraw.h>
#include <ToolUtils.h>
Cursor textCrsr; [TOKEN:12074] allocate a 68-byte struct */ cursH = GetCursor( iBeamCursor ); /* constant in ToolboxUtil.h */ textCrsr = **cursH; [TOKEN:12074] copy the data */
GetMouse( &mPt ); [TOKEN:12074] find where mouse is */ if (inTEArea) /* if it's in text editing area . . . */
else [TOKEN:12074] must be in desktop . . . */
SetCursor( &arrow ); [TOKEN:12074] access the global address */