rem: W_Screen	*scr = WMWidgetScreen(panel->win);  if (mode != WMWheelModeColorPanel) { WMUnmapWidget(panel->wheelFrm); if (panel->selectionBackImg) { XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg); panel->selectionBackImg = None; } } if (mode != WMGrayModeColorPanel) WMUnmapWidget(panel->grayFrm); if (mode != WMRGBModeColorPanel) WMUnmapWidget(panel->rgbFrm); if (mode != WMCMYKModeColorPanel) WMUnmapWidget(panel->cmykFrm); if (mode != WMHSBModeColorPanel) WMUnmapWidget(panel->hsbFrm); if (mode != WMCustomPaletteModeColorPanel) { WMUnmapWidget(panel->customPaletteFrm); if (panel->selectionBackImg) { XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg); panel->selectionBackImg = None; } } if (mode != WMColorListModeColorPanel) WMUnmapWidget(panel->colorListFrm); if ((mode != WMGrayModeColorPanel) && (mode != WMRGBModeColorPanel) && \ (mode != WMCMYKModeColorPanel) && (mode != WMHSBModeColorPanel)) WMUnmapWidget(panel->slidersFrm); else panel->slidersmode = mode;  if (mode == WMWheelModeColorPanel) { WMMapWidget(panel->wheelFrm); WMSetButtonSelected(panel->wheelBtn, True); if (panel->lastChanged != WMWheelModeColorPanel) wheelInit(panel); wheelRender(panel); wheelPaint(panel); } else if (mode == WMGrayModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->grayFrm); WMSetButtonSelected(panel->grayBtn, True); WMSetButtonImage(panel->slidersBtn, scr->grayIcon); WMSetButtonAltImage(panel->slidersBtn,scr->grayAltIcon); if (panel->lastChanged != WMGrayModeColorPanel) grayInit(panel); } else if (mode == WMRGBModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->rgbFrm); WMSetButtonSelected(panel->rgbBtn, True); WMSetButtonImage(panel->slidersBtn, scr->rgbIcon); WMSetButtonAltImage(panel->slidersBtn, scr->rgbAltIcon); if (panel->lastChanged != WMRGBModeColorPanel) rgbInit(panel); } else if (mode == WMCMYKModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->cmykFrm); WMSetButtonSelected(panel->cmykBtn, True); WMSetButtonImage(panel->slidersBtn, scr->cmykIcon); WMSetButtonAltImage(panel->slidersBtn, scr->cmykAltIcon); if (panel->lastChanged != WMCMYKModeColorPanel) cmykInit(panel); } else if (mode == WMHSBModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->hsbFrm); WMSetButtonSelected(panel->hsbBtn, True); WMSetButtonImage(panel->slidersBtn, scr->hsbIcon); WMSetButtonAltImage(panel->slidersBtn, scr->hsbAltIcon); if (panel->lastChanged != WMHSBModeColorPanel) hsbInit(panel); } else if (mode == WMCustomPaletteModeColorPanel) { WMMapWidget(panel->customPaletteFrm); WMSetButtonSelected(panel->customPaletteBtn, True); customSetPalette(panel); } else if (mode == WMColorListModeColorPanel) { WMMapWidget(panel->colorListFrm); WMSetButtonSelected(panel->colorListBtn, True); }   panel->mode = mode;
add: W_Screen    *scr = WMWidgetScreen(panel->win);  if (mode != WMWheelModeColorPanel) { WMUnmapWidget(panel->wheelFrm); if (panel->selectionBackImg) { XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg); panel->selectionBackImg = None; } } if (mode != WMGrayModeColorPanel) WMUnmapWidget(panel->grayFrm); if (mode != WMRGBModeColorPanel) WMUnmapWidget(panel->rgbFrm); if (mode != WMCMYKModeColorPanel) WMUnmapWidget(panel->cmykFrm); if (mode != WMHSBModeColorPanel) WMUnmapWidget(panel->hsbFrm); if (mode != WMCustomPaletteModeColorPanel) { WMUnmapWidget(panel->customPaletteFrm); if (panel->selectionBackImg) { XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg); panel->selectionBackImg = None; } } if (mode != WMColorListModeColorPanel) WMUnmapWidget(panel->colorListFrm); if ((mode != WMGrayModeColorPanel) && (mode != WMRGBModeColorPanel) && \ (mode != WMCMYKModeColorPanel) && (mode != WMHSBModeColorPanel)) WMUnmapWidget(panel->slidersFrm); else panel->slidersmode = mode;  if (mode == WMWheelModeColorPanel) { WMMapWidget(panel->wheelFrm); WMSetButtonSelected(panel->wheelBtn, True); if (panel->lastChanged != WMWheelModeColorPanel) wheelInit(panel); wheelRender(panel); wheelPaint(panel); } else if (mode == WMGrayModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->grayFrm); WMSetButtonSelected(panel->grayBtn, True); WMSetButtonImage(panel->slidersBtn, scr->grayIcon); if (panel->lastChanged != WMGrayModeColorPanel) grayInit(panel); } else if (mode == WMRGBModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->rgbFrm); WMSetButtonSelected(panel->rgbBtn, True); WMSetButtonImage(panel->slidersBtn, scr->rgbIcon); if (panel->lastChanged != WMRGBModeColorPanel) rgbInit(panel); } else if (mode == WMCMYKModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->cmykFrm); WMSetButtonSelected(panel->cmykBtn, True); WMSetButtonImage(panel->slidersBtn, scr->cmykIcon); if (panel->lastChanged != WMCMYKModeColorPanel) cmykInit(panel); } else if (mode == WMHSBModeColorPanel) { WMMapWidget(panel->slidersFrm); WMSetButtonSelected(panel->slidersBtn, True); WMMapWidget(panel->hsbFrm); WMSetButtonSelected(panel->hsbBtn, True); WMSetButtonImage(panel->slidersBtn, scr->hsbIcon); if (panel->lastChanged != WMHSBModeColorPanel) hsbInit(panel); } else if (mode == WMCustomPaletteModeColorPanel) { WMMapWidget(panel->customPaletteFrm); WMSetButtonSelected(panel->customPaletteBtn, True); customSetPalette(panel); } else if (mode == WMColorListModeColorPanel) { WMMapWidget(panel->colorListFrm); WMSetButtonSelected(panel->colorListBtn, True); }   panel->mode = mode;
context: WMSetPickerMode(WMColorPanel *panel, WMColorPanelMode mode){	W_Screen	*scr = WMWidgetScreen(panel->win);	if (mode != WMWheelModeColorPanel) {		WMUnmapWidget(panel->wheelFrm);		if (panel->selectionBackImg) {			XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg);			panel->selectionBackImg = None;		}	}	if (mode != WMGrayModeColorPanel)		WMUnmapWidget(panel->grayFrm);	if (mode != WMRGBModeColorPanel)		WMUnmapWidget(panel->rgbFrm);	if (mode != WMCMYKModeColorPanel)		WMUnmapWidget(panel->cmykFrm);	if (mode != WMHSBModeColorPanel)		WMUnmapWidget(panel->hsbFrm);	if (mode != WMCustomPaletteModeColorPanel) {		WMUnmapWidget(panel->customPaletteFrm);		if (panel->selectionBackImg) {			XFreePixmap(WMWidgetScreen(panel->win)->display, panel->selectionBackImg);			panel->selectionBackImg = None;		}	}	if (mode != WMColorListModeColorPanel)		WMUnmapWidget(panel->colorListFrm);	if ((mode != WMGrayModeColorPanel) && (mode != WMRGBModeColorPanel) && \		(mode != WMCMYKModeColorPanel) && (mode != WMHSBModeColorPanel))		WMUnmapWidget(panel->slidersFrm);	else		panel->slidersmode = mode;	if (mode == WMWheelModeColorPanel) {		WMMapWidget(panel->wheelFrm);		WMSetButtonSelected(panel->wheelBtn, True);		if (panel->lastChanged != WMWheelModeColorPanel)			wheelInit(panel);		wheelRender(panel);		wheelPaint(panel);	} else if (mode == WMGrayModeColorPanel) {		WMMapWidget(panel->slidersFrm);		WMSetButtonSelected(panel->slidersBtn, True);		WMMapWidget(panel->grayFrm);		WMSetButtonSelected(panel->grayBtn, True);		WMSetButtonImage(panel->slidersBtn, scr->grayIcon);		WMSetButtonAltImage(panel->slidersBtn,scr->grayAltIcon);		if (panel->lastChanged != WMGrayModeColorPanel)			grayInit(panel);	} else if (mode == WMRGBModeColorPanel) {		WMMapWidget(panel->slidersFrm);		WMSetButtonSelected(panel->slidersBtn, True);		WMMapWidget(panel->rgbFrm);		WMSetButtonSelected(panel->rgbBtn, True);		WMSetButtonImage(panel->slidersBtn, scr->rgbIcon);		WMSetButtonAltImage(panel->slidersBtn, scr->rgbAltIcon);		if (panel->lastChanged != WMRGBModeColorPanel)			rgbInit(panel);	} else if (mode == WMCMYKModeColorPanel) {		WMMapWidget(panel->slidersFrm);		WMSetButtonSelected(panel->slidersBtn, True);		WMMapWidget(panel->cmykFrm);		WMSetButtonSelected(panel->cmykBtn, True);		WMSetButtonImage(panel->slidersBtn, scr->cmykIcon);		WMSetButtonAltImage(panel->slidersBtn, scr->cmykAltIcon);		if (panel->lastChanged != WMCMYKModeColorPanel)			cmykInit(panel);	} else if (mode == WMHSBModeColorPanel) {		WMMapWidget(panel->slidersFrm);		WMSetButtonSelected(panel->slidersBtn, True);		WMMapWidget(panel->hsbFrm);		WMSetButtonSelected(panel->hsbBtn, True);		WMSetButtonImage(panel->slidersBtn, scr->hsbIcon);		WMSetButtonAltImage(panel->slidersBtn, scr->hsbAltIcon);		if (panel->lastChanged != WMHSBModeColorPanel)			hsbInit(panel);	} else if (mode == WMCustomPaletteModeColorPanel) {		WMMapWidget(panel->customPaletteFrm);		WMSetButtonSelected(panel->customPaletteBtn, True);		customSetPalette(panel);	} else if (mode == WMColorListModeColorPanel) {		WMMapWidget(panel->colorListFrm);		WMSetButtonSelected(panel->colorListBtn, True);	}		panel->mode = mode;}