![]() |
List Definition Constants |
Header: Lists.h |
enum { lInitMsg = 0, lDrawMsg = 1, lHiliteMsg = 2, lCloseMsg = 3 };
In response to the lInitMsg message, your list definition function should perform any special initialization needed for a list. For example, the function might set fields of the list record, such as the cellSize and indent fields, to appropriate values. Your list definition function does not necessarily need to do anything in response to the initialization message. If it does nothing, then memory is still allocated for the list, and fields of the list record are set to the same values as they would be set to if the default list definition function were being used.
Your list definition function should draw the cell specified by the theCell parameter after receiving an lDrawMsg message. The function must ensure that it does not draw anywhere but within the rectangle specified by the cellRect parameter. If the selected parameter is TRUE, then your list definition function should draw the cell in its highlighted state; otherwise, it should draw the cell without highlighting. When drawing, your list definition function should take care not to permanently change any characteristics of the drawing environment.
Your list definition function should respond to the lHiliteMsg message by reversing the selection status of the cell contained within the rectangle specified by the cellRect parameter. If a cell is highlighted, your list definition function should remove the highlighting; if a cell is not highlighted, your list definition function should highlight it.
The List Manager sends your list definition function an lCloseMsg message before it disposes of a list and its data. Your list definition function need only respond to this message if additional memory has been allocated for the list. For example, your list definition function might allocate a relocatable block in response to the lInitMsg message. In this case, your list definition function would need to dispose of this relocatable block in response to the lCloseMsg message. Or, if your list definition function defines cells simply to contain pointers or handles to data stored elsewhere in memory, it would need to dispose of that memory in response to the lCloseMsg message.
The List Manager passes these values to your ListDefProcPtr function to identify the operation to be performed.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)