rem: scr->wmscreen->drawStringGC = textGC; color->color.pixel = pixel;
context: paintEntry(WMenu *menu, int index, int selected){    int x, y, w, h, tw;    int type;    GC light, dim, dark, textGC, saveGC;    WMColor *color;    WMPixel pixel, savePixel;    WScreen *scr=menu->frame->screen_ptr;    Window win = menu->menu->window;    WMenuEntry *entry=menu->entries[index];    if (!menu->flags.realized) return;    h = menu->entry_height;    w = menu->menu->width;    y = index * h;    light = scr->menu_item_auxtexture->light_gc;    dim = scr->menu_item_auxtexture->dim_gc;    dark = scr->menu_item_auxtexture->dark_gc;    if (wPreferences.menu_style == MS_FLAT && menu->entry_no > 1) {	if (index == 0)	    type = F_TOP;	else if (index == menu->entry_no - 1)	    type = F_BOTTOM;	else	    type = F_NONE;    } else {	type = F_NORMAL;    }        /* paint background */    if (selected) {	XSetForeground(dpy, scr->select_menu_gc, scr->select_pixel);	XFillRectangle(dpy, win, scr->select_menu_gc, 1, y+1, w-2, h-3);	if (scr->menu_item_texture->any.type == WTEX_SOLID)	    drawFrame(scr, win, y, w, h, type);    } else { 	if (scr->menu_item_texture->any.type == WTEX_SOLID) {	    XClearArea(dpy, win, 0, y + 1, w - 1, h - 3, False);	    /* draw the frame */	    drawFrame(scr, win, y, w, h, type);	} else {	    XClearArea(dpy, win, 0, y, w, h, False);	}    }    /* very ugly hack */    saveGC = scr->wmscreen->drawStringGC;    color = WMBlackColor(scr->wmscreen);    savePixel = color->color.pixel;    if (selected) {	textGC = scr->select_menu_gc;	if (entry->flags.enabled)             pixel = scr->select_text_pixel;	else            pixel = scr->dtext_pixel;    } else if (!entry->flags.enabled) {        textGC = scr->disabled_menu_entry_gc;        pixel = scr->dtext_pixel;    } else {        textGC = scr->menu_entry_gc;        pixel = scr->mtext_pixel;    }    /* draw text */        x = 5;    if (entry->flags.indicator)	x += MENU_INDICATOR_SPACE + 2;    /* this is nasty */    scr->wmscreen->drawStringGC = textGC;    color->color.pixel = pixel;    WMDrawString(scr->wmscreen, win, color, scr->menu_entry_font,		 x, 3 + y + wPreferences.menu_text_clearance, entry->text, strlen(entry->text));    color->color.pixel = savePixel;    scr->wmscreen->drawStringGC = saveGC;    if (entry->cascade>=0) {	/* draw the cascade indicator */	XDrawLine(dpy,win,dim, w-11, y+6, w-6, y+h/2-1);	XDrawLine(dpy,win,light, w-11, y+h-8, w-6, y+h/2-1);	XDrawLine(dpy,win,dark, w-12, y+6, w-12, y+h-8);    }    /* draw indicator */    if (entry->flags.indicator && entry->flags.indicator_on) {	int iw, ih;	WPixmap *indicator;		switch (entry->flags.indicator_type) {	 case MI_CHECK:	    indicator = scr->menu_check_indicator;	    break;	 case MI_MINIWINDOW:	    indicator = scr->menu_mini_indicator;	    break;	 case MI_HIDDEN:	    indicator = scr->menu_hide_indicator;	    break;	 case MI_SHADED:	    indicator = scr->menu_shade_indicator;	    break;	 case MI_DIAMOND:	 default:	    indicator = scr->menu_radio_indicator;	    break;	}		iw = indicator->width;	ih = indicator->height;	XSetClipMask(dpy, scr->copy_gc, indicator->mask);	XSetClipOrigin(dpy, scr->copy_gc, 5, y+(h-ih)/2);        if (selected) {            if (entry->flags.enabled) {                XSetForeground(dpy, scr->copy_gc, scr->black_pixel);            } else {                XSetForeground(dpy, scr->copy_gc, scr->dtext_pixel);            }        } else {            if (entry->flags.enabled) {                XSetForeground(dpy, scr->copy_gc, scr->mtext_pixel);            } else {                XSetForeground(dpy, scr->copy_gc, scr->dtext_pixel);            }        }	XFillRectangle(dpy, win, scr->copy_gc, 5, y+(h-ih)/2, iw, ih);	/*	XCopyArea(dpy, indicator->image, win, scr->copy_gc, 0, 0,		  iw, ih, 5, y+(h-ih)/2);	 */	XSetClipOrigin(dpy, scr->copy_gc, 0, 0);    }    /* draw right text */        if (entry->rtext && entry->cascade<0) {        tw = WMWidthOfString(scr->menu_entry_font, entry->rtext,                             strlen(entry->rtext));        /* this is nasty */        scr->wmscreen->drawStringGC = textGC;        color->color.pixel = pixel;        WMDrawString(scr->wmscreen, win, color, scr->menu_entry_font, w-6-tw,                     y + 3 + wPreferences.menu_text_clearance, entry->rtext, strlen(entry->rtext));        color->color.pixel = savePixel;        scr->wmscreen->drawStringGC = saveGC;    }    WMReleaseColor(color);}