rem: W_PaintText(view, d, scr->normalFont,  x+4, y, width, WALeft, W_GC(scr->black), False, text, strlen(text));
add: int textLen = strlen(text); int widthC = (state & WLDSIsBranch) ? width-20 : width-8; if (WMWidthOfString(scr->normalFont, text, textLen) > widthC) { char *textBuf = createTruncatedString(scr->normalFont, text, &textLen, widthC); W_PaintText(view, d, scr->normalFont,  x+4, y, widthC, WALeft, W_GC(scr->black), False, textBuf, textLen); free(textBuf); } else { W_PaintText(view, d, scr->normalFont,  x+4, y, widthC, WALeft, W_GC(scr->black), False, text, textLen); }
context: paintItem(WMList *lPtr, int index, Drawable d, char *text, int state, 	  WMRect *rect){    WMView *view = W_VIEW(lPtr);    W_Screen *scr = view->screen;    int width, height, x, y;    width = rect->size.width;    height = rect->size.height;    x = rect->pos.x;    y = rect->pos.y;    if (state & WLDSSelected)	XFillRectangle(scr->display, d, W_GC(scr->white), x, y,		       width, height);    else 	XClearArea(scr->display, d, x, y, width, height, False);    if (text) {      	W_PaintText(view, d, scr->normalFont,  x+4, y, width,		    WALeft, W_GC(scr->black), False, text, strlen(text));    }    if (state & WLDSIsBranch) {	XDrawLine(scr->display, d, W_GC(scr->darkGray), x+width-11, y+3,		  x+width-6, y+height/2);	if (state & WLDSSelected)	    XDrawLine(scr->display, d,W_GC(scr->gray), x+width-11, y+height-5,		      x+width-6, y+height/2);	else	    XDrawLine(scr->display, d,W_GC(scr->white), x+width-11, y+height-5,		      x+width-6, y+height/2);	XDrawLine(scr->display, d, W_GC(scr->black), x+width-12, y+3,		  x+width-12, y+height-5);    }}