rem: int itemCount = WMGetBagItemCount(lPtr->items);
add: int itemCount = WMGetArrayItemCount(lPtr->items);
context: handleActionEvents(XEvent *event, void *data){    List *lPtr = (List*)data;    int tmp;    int topItem = lPtr->topItem;    CHECK_CLASS(data, WC_List);    switch (event->type) {     case ButtonRelease:#define CHECK_WHEEL_PATCH#ifdef CHECK_WHEEL_PATCH        /* Ignore mouse wheel events, they're not "real" button events */        if (event->xbutton.button == WINGsConfiguration.mouseWheelUp ||            event->xbutton.button == WINGsConfiguration.mouseWheelDown)            break;#endif	lPtr->flags.buttonPressed = 0;	tmp = getItemIndexAt(lPtr, event->xbutton.y);	if (tmp == lPtr->selectedItem && tmp >= 0) {	    if (lPtr->action)		(*lPtr->action)(lPtr, lPtr->clientData);	}	break;     case EnterNotify:	lPtr->flags.buttonPressed = lPtr->flags.buttonWasPressed;	lPtr->flags.buttonWasPressed = 0;	break;     case LeaveNotify:	lPtr->flags.buttonWasPressed = lPtr->flags.buttonPressed;	lPtr->flags.buttonPressed = 0;	break;     case ButtonPress:	if (event->xbutton.x > WMWidgetWidth(lPtr->vScroller)) {#ifdef CHECK_WHEEL_PATCH            /* Mouse wheel events need to be properly handled here. It would             * be best to somehow route them to lPtr->vScroller so that the             * correct chain of actions is triggered. However, I found no             * clean way to do so, so I mostly copied the code that deals with             * WSIncrementPage and WSDecrementPage from vScrollCallBack.             *             *          - Martynas Kunigelis <diskena@linuxfreak.com> */            if (event->xbutton.button == WINGsConfiguration.mouseWheelDown) {                /* Wheel down */                int itemCount = WMGetBagItemCount(lPtr->items);                if (lPtr->topItem + lPtr->fullFitLines < itemCount) {                    int incr = lPtr->fullFitLines-(1-lPtr->flags.dontFitAll)-1;                    lPtr->topItem += incr;                    if (lPtr->topItem + lPtr->fullFitLines > itemCount)                        lPtr->topItem = itemCount - lPtr->fullFitLines;                    updateScroller(lPtr);                }                break;            }            if (event->xbutton.button == WINGsConfiguration.mouseWheelUp) {                /* Wheel up */                if (lPtr->topItem > 0) {                    int decr = lPtr->fullFitLines-(1-lPtr->flags.dontFitAll)-1;                    lPtr->topItem -= decr;                    if (lPtr->topItem < 0)                        lPtr->topItem = 0;                    updateScroller(lPtr);                }                break;            }#endif            tmp = getItemIndexAt(lPtr, event->xbutton.y);	    lPtr->flags.buttonPressed = 1;	    if (tmp >= 0) {		if (tmp == lPtr->selectedItem && WMIsDoubleClick(event)) {		    WMSelectListItem(lPtr, tmp);		    if (lPtr->doubleAction)			(*lPtr->doubleAction)(lPtr, lPtr->doubleClientData);		} else {		    WMSelectListItem(lPtr, tmp);		}	    }	}	break;	     case MotionNotify:	if (lPtr->flags.buttonPressed) {	    tmp = getItemIndexAt(lPtr, event->xmotion.y);	    if (tmp>=0 && tmp != lPtr->selectedItem) {		WMSelectListItem(lPtr, tmp);	    }	}	break;    }    if (lPtr->topItem != topItem)    	WMPostNotificationName(WMListDidScrollNotification, lPtr, NULL);}