callbacks.v1_itemCompareCallback = display.itemCompareProc;
void checkItems (boolean setScrollWidth) {	int [] count = new int [1];	if (OS.GetDataBrowserItemCount (handle, OS.kDataBrowserNoItem, true, OS.kDataBrowserItemAnyState, count) != OS.noErr) {		error (SWT.ERROR_CANNOT_GET_COUNT);	}	if (itemCount != count [0]) {		/*		* Feature in the Mac. When AddDataBrowserItems() is used		* to add items, item notification callbacks are issued with		* the message kDataBrowserItemAdded.  When many items are		* added, this is slow.  The fix is to temporarily remove		* the item notification callback.		*/		DataBrowserCallbacks callbacks = new DataBrowserCallbacks ();		OS.GetDataBrowserCallbacks (handle, callbacks);		callbacks.v1_itemNotificationCallback = 0;		OS.SetDataBrowserCallbacks (handle, callbacks);		int delta = itemCount - count [0];		if (delta < 1024) {			int [] ids = new int [delta];			for (int i=0; i<ids.length; i++) {				ids [i] = count [0] + i + 1;			}			if (OS.AddDataBrowserItems (handle, OS.kDataBrowserNoItem, ids.length, ids, OS.kDataBrowserItemNoProperty) != OS.noErr) {				error (SWT.ERROR_ITEM_NOT_ADDED);			}			OS.UpdateDataBrowserItems (handle, 0, 0, null, OS.kDataBrowserItemNoProperty, OS.kDataBrowserNoItem);		} else {			if (OS.AddDataBrowserItems (handle, 0, itemCount, null, OS.kDataBrowserItemNoProperty) != OS.noErr) {				error (SWT.ERROR_ITEM_NOT_ADDED);			}		}		callbacks.v1_itemNotificationCallback = display.itemNotificationProc;		OS.SetDataBrowserCallbacks (handle, callbacks);	}	if (setScrollWidth) setScrollWidth (items, true);}