rem: if (index < 0 || index >= WMGetBagItemCount(lPtr->items)) return -1;
add: if (index < 0 || index >= WMGetArrayItemCount(lPtr->items)) return -1;
context: getItemIndexAt(List *lPtr, int clickY){    int index;    index = (clickY - 2) / lPtr->itemHeight + lPtr->topItem;    if (index < 0 || index >= WMGetBagItemCount(lPtr->items))	return -1;    return index;}