Carbon


ListClickLoopProcPtr

Header: Lists.h Carbon status: Supported

Defines a pointer to a list click loop callback function. Your list click loop callback function overrides the standard click-loop function that is used to select cells and automatically scroll a list.

typedef Boolean(* ListClickLoopProcPtr) ();

You would declare your function like this if you were to name it MyListClickLoopCallback:

Boolean MyListClickLoopCallback ();
function result

A value indicating whether the LClick function should continue tracking the mouse. Your function should return TRUE if you wish LClick to continue to track the mouse, and FALSE if LClick should stop and return immediately.

DISCUSSION

If your application defines a custom click-loop function, then the LClick function repeatedly calls the function until the user releases the mouse button. A click-loop function may perform any processing desired when it is executed.

Because no parameters are passed to the click-loop function, your click-loop function probably needs to access a global variable that contains a handle to the list record, which contains information about the location of the cursor and other information potentially of interest to a click-loop function. You might also create a global variable that stores the state of the modifier keys immediately before a call to the LClick function. You would need to set these global variables immediately before calling LClick.

The pointer to your function, which you provide in the list record structure, should be a universal procedure pointer (UPP). The definition of the UPP data type for your list click loop function is as follows:

typedef (ListClickLoopProcPtr) ListClickLoopUPP;

Before using your list click loop function, you must first create a new universal procedure pointer to it, using the NewListClickLoopUPP function, as shown here:

ListClickLoopUPP MyListClickLoopUPP;

MyListClickLoopUPP = NewListClickLoopUPP(&MyListClickLoopProc);

You then use MyListClickLoopUPP in the lClickLoop field of the ListRec structure for your list. The LClick function calls your list click loop function while the user holds down the mouse button. If you wish to call your own list click loop function, you can use the InvokeListClickLoopUPP function:

continueTracking = InvokeListClickLoopUPP(MyListClickLoopUPP);

When you are finished using your list click loop callback function, you should dispose of the universal procedure pointer associated with it, using the DisposeListClickLoopUPP function.

DisposeListClickLoopUPP(MyListClickLoopUPP);

A click-loop function does not execute at interrupt time. Instead, it is called directly by the LClick function. Thus, a click-loop function can allocate memory, and it does not need to adjust the value contained in the A5 register.

SPECIAL CONSIDERATIONS

A click-loop function does not execute at interrupt time. Instead, it is called directly by the LClick function. Thus, a click-loop function can allocate memory, and it does not need to adjust the value contained in the A5 register.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)