Carbon


LAddColumn

Header: Lists.h Carbon status: Supported

Adds one or more columns to a list.

SInt16 LAddColumn (
    SInt16 count, 
    SInt16 colNum, 
    ListHandle lHandle
);
count

The number of columns to add.

colNum

The column number of the first column to add.

lHandle

The list to which to add the columns.

function result

The column number of the first column added, which is equal to the value specified by the colNum parameter if that value is a valid column number. If the column number specified by colNum is not already in the list, then new last columns are added. The value returned by this function thus has significance only in this case. 0

DISCUSSION

This function inserts columns starting at the column specified by the colNum parameter. If there is insufficient memory in the heap to add the new columns, this function may fail to add the new columns although it returns a positive function result. Be sure there is enough memory in the heap to allocate the new columns before calling LAddColumn.

Columns whose column numbers are initially greater than colNum have their column numbers increased by count.

If the automatic drawing mode is enabled and the columns added by the function are visible, then the list (including its scroll bars) is updated. New cells created by a call to this function are initially empty.

You may add columns to a list that does not yet have rows. The dataBounds field of the list record reflects that the list has columns, but you can only access cells when both rows and columns have been added.

SPECIAL CONSIDERATIONS

This function is contained in a resource of resource type 'PACK'. Calling it could result in the loading of the package resource and the allocation of memory. Thus, your application should not call this function from within an interrupt, such as in a completion function or VBL task.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when InterfaceLib 7.1 or later is installed. Exported by CarbonLib 1.0 and later and by InterfaceLib 7.1 and later.


© 2000 Apple Computer, Inc. — (Last Updated 3/23/2000)