TreeItem item = items [index];
TreeItem item = _getItem (id, true);
int drawItemProc (int browser, int id, int property, int itemState, int theRect, int gdDepth, int colorDevice) {	int index = id - 1;	if (!(0 <= index && index < items.length)) return OS.noErr;	int columnIndex = 0;	if (columnCount > 0) {		for (columnIndex=0; columnIndex<columnCount; columnIndex++) {			if (columns [columnIndex].id == property) break;		}		if (columnIndex == columnCount) return OS.noErr;	}	Rect controlRect = new Rect ();	if (!OS.HIVIEW) OS.GetControlBounds (handle, controlRect);	TreeItem item = items [index];	if ((style & SWT.VIRTUAL) != 0) {		if (!item.cached) {			if (!checkData (item, false)) return OS.noErr;			if (setScrollWidth (item)) {				Rect rect = new Rect();				if (OS.GetDataBrowserItemPartBounds (handle, id, property, OS.kDataBrowserPropertyEnclosingPart, rect) == OS.noErr) {					int x = rect.left - controlRect.left;					int y = rect.top - controlRect.top;					int width = rect.right - rect.left;					int height = rect.bottom - rect.top;					redrawWidget (handle, x, y, width, height, false);				}				return OS.noErr;			}		}	}	Rect rect = new Rect ();	OS.memcpy (rect, theRect, Rect.sizeof);	int x = rect.left;	int y = rect.top;	int width = rect.right - rect.left;	int height = rect.bottom - rect.top;	boolean selected = (itemState & OS.kDataBrowserItemIsSelected) != 0;	x -= controlRect.left;	y -= controlRect.top;	GC gc = paintGC;	if (gc == null) {		GCData data = new GCData ();		int [] port = new int [1];		OS.GetPort (port);		data.port = port [0];		gc = GC.carbon_new (this, data);	}	OS.CGContextSaveGState (gc.handle);	int clip = OS.NewRgn ();	OS.GetClip (clip);	OS.OffsetRgn (clip, (short)-controlRect.left, (short)-controlRect.top);	gc.setClipping (Region.carbon_new (display, clip));	Rect itemRect = new Rect();	OS.GetDataBrowserItemPartBounds (handle, id, property, OS.kDataBrowserPropertyEnclosingPart, itemRect);	OS.OffsetRect (itemRect, (short) -controlRect.left, (short) -controlRect.top);	if (background != null || item.background != null || (item.cellBackground != null && item.cellBackground [columnIndex] != null)) {		gc.setBackground (item.getBackground (columnIndex));		int gridWidth = getLinesVisible () ? GRID_WIDTH : 0;		gc.fillRectangle (itemRect.left + gridWidth, itemRect.top, itemRect.right - itemRect.left - gridWidth, itemRect.bottom - itemRect.top + 1);	}	if (selected && (style & SWT.FULL_SELECTION) != 0) {		if ((style & SWT.HIDE_SELECTION) == 0 || hasFocus ()) {			gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));			int gridWidth = getLinesVisible () ? GRID_WIDTH : 0;			gc.fillRectangle (itemRect.left + gridWidth, itemRect.top, itemRect.right - itemRect.left - gridWidth, itemRect.bottom - itemRect.top);		}	}	int rectRgn = OS.NewRgn ();	OS.RectRgn (rectRgn, rect);	OS.OffsetRgn (rectRgn, (short)-controlRect.left, (short)-controlRect.top);	OS.SectRgn (rectRgn, clip, clip);	OS.DisposeRgn (rectRgn);	gc.setClipping (Region.carbon_new (display, clip));	OS.DisposeRgn (clip);	Image image = item.getImage (columnIndex);	String text = item.getText (columnIndex);	gc.setFont (item.getFont (columnIndex));	Point extent = gc.stringExtent (text);	int itemWidth = extent.x;	Rectangle imageBounds = null;	int gap = getGap ();	if (image != null) {		imageBounds = image.getBounds ();		itemWidth += this.imageBounds.width + gap;	}	if (columnCount != 0) {		TreeColumn column = columns [columnIndex];		if ((column.style & SWT.CENTER) != 0) x += (width - itemWidth) / 2;		if ((column.style & SWT.RIGHT) != 0) x += width - itemWidth;	}	if (image != null) {		gc.drawImage (image, 0, 0, imageBounds.width, imageBounds.height, x, y + (height - this.imageBounds.height) / 2, this.imageBounds.width, this.imageBounds.height);		x += this.imageBounds.width + gap;	}	if (selected) {		gc.setForeground (display.getSystemColor (SWT.COLOR_LIST_SELECTION_TEXT));		if (columnIndex == 0 && (style & SWT.FULL_SELECTION) == 0) {			if ((style & SWT.HIDE_SELECTION) == 0 || hasFocus ()) {				gc.setBackground (display.getSystemColor (SWT.COLOR_LIST_SELECTION));				gc.fillRectangle (x - 1, y, extent.x + 2, itemRect.bottom - itemRect.top);			}		}	} else {		Color foreground = item.getForeground (columnIndex);		gc.setForeground (foreground);	}	gc.drawString (text, x, y + (height - extent.y) / 2, true);	OS.CGContextRestoreGState (gc.handle);	if (gc != paintGC) gc.dispose ();	return OS.noErr;}