add: perm_mask = (access(filename, W_OK) == 0); WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRename, perm_mask); WMSetPopUpButtonItemEnabled(panel->customPaletteMenuBtn, CPmenuRemove, perm_mask);
context: customPaletteHistoryCallback(WMWidget *w, void *data){    W_ColorPanel	*panel = (W_ColorPanel*)data;    W_Screen		*scr = WMWidgetScreen(panel->win);    int			item;    char		*filename;    RImage		*tmp = NULL;        item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);    if (item == panel->currentPalette)	return;        if (item == 0)	customRenderSpectrum(panel);    else {	/* Load file from configpath */	filename = wstrappend( panel->configurationPath, 			      WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item) );		/* XXX To do: Check existence of file and remove it from the history 	 * if it doesn't exist */		tmp = RLoadImage(scr->rcontext,  filename, 0);	if (tmp) {	    if (panel->customPaletteImg) {		RDestroyImage(panel->customPaletteImg);		panel->customPaletteImg = NULL;	    }	    panel->customPaletteImg = tmp;	}	wfree(filename);    }    customSetPalette(panel);        panel->currentPalette = item;}