![]() |
LNew |
||||
Header: | Lists.h | Carbon status: | Supported | |
Creates a new list in a window.
ListHandle LNew ( const Rect *rView, const ListBounds *dataBounds, Point cSize, SInt16 theProc, WindowRef theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert );
A pointer to the rectangle in which to display the list, in local coordinates of the window specified by the theWindow parameter. This rectangle does not include the area to be taken up by the lists scroll bars.
A pointer to the initial data bounds for the list. By setting the left and top fields of this rectangle to (0,0) and the right and bottom fields to (kMyInitialColumns, kMyInitialRows), your application can create a list that has kMyInitialColumns columns and kMyInitialRows rows.
The size of each cell in the list. If your application specifies (0,0) and is using the default list definition function, the List Manager sets the v coordinate of this parameter to the sum of the ascent, descent, and leading of the current font, and it sets the h coordinate using the following formula:
cSize.h = (rView.right - rView.left) / (dataBounds.right dataBounds.left)
The resource ID of the list definition function to use for the list. To use the default list definition function, which supports the display of unstyled text, specify a resource ID of 0.
A pointer to the window in which to install the list.
Indicates whether the List Manager should initially enable the automatic drawing mode. When the automatic drawing mode is enabled, the List Manager automatically redraws the list whenever a change is made to it. You can later change this setting using the LSetDrawingMode function. Your application should leave the automatic drawing mode disabled only for short periods of time when making changes to a list (by, for example, adding rows and columns).
Indicates whether the List Manager should leave room for a size box. The List Manager does not actually draw the grow icon. Usually, your application can draw it with the Window Managers DrawGrowIcon function.
Indicates whether the list should contain a horizontal scroll bar. Specify TRUE if your list requires a horizontal scroll bar; specify FALSE otherwise.
Indicates whether the list should contain a vertical scroll bar. Specify TRUE if your list requires a vertical scroll bar; specify FALSE otherwise.
A handle to the newly created list, or if the function cannot allocate the list, NULL. This might happen if there is not enough memory available or if the function cannot load the resource specified by the theProc parameter. If it returns successfully, then all of the fields of the list record referenced by the returned handle are correctly set.
If the list contains a horizontal or vertical scroll bar and the window specified by the parameter theWindow is visible, this function draws the scroll bar for the new list in the window just outside the lists visible rectangle specified by the rView parameter. This function does not, however, draw a 1-pixel border around the lists visible rectangle.
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.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)