rem: W_Screen	*scr = WMWidgetScreen(panel->win); char		*text; char		*tmp; int		choice; int		item;  item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);  tmp = wstrappend( "This will permanently remove the palette ", WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item )); text = wstrappend( tmp, ".\n\nAre you sure you want to remove this palette ?"); free(tmp);  choice = WMRunAlertPanel(scr, panel->win, NULL, text, "Yes", "No", NULL);  free(text);  if (choice == 0) {  tmp = wstrappend(panel->configurationPath, WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));  if ( remove(tmp) != 0) wwarning("Couldn't remove palette %s\n", tmp); free(tmp);  WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn, item-1);	 customPaletteHistoryCallback(panel->customPaletteHistoryBtn, panel); customSetPalette(panel);  WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item); }
add: W_Screen    *scr = WMWidgetScreen(panel->win); char        *text; char        *tmp; int        choice; int        item;  item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);  tmp = wstrappend( "This will permanently remove the palette ", WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item )); text = wstrappend( tmp, ".\n\nAre you sure you want to remove this palette ?"); free(tmp);  choice = WMRunAlertPanel(scr, panel->win, NULL, text, "Yes", "No", NULL);  free(text);  if (choice == 0) {  tmp = wstrappend(panel->configurationPath, WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));  if ( remove(tmp) != 0) wsyserror("Couldn't remove palette %s\n", tmp); free(tmp);  WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn, item-1);     customPaletteHistoryCallback(panel->customPaletteHistoryBtn, panel); customSetPalette(panel);  WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item); }
context: customPaletteMenuRemove(W_ColorPanel *panel){	W_Screen	*scr = WMWidgetScreen(panel->win);	char		*text;	char		*tmp;	int		choice;	int		item;	item = WMGetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn);	tmp = wstrappend( "This will permanently remove the palette ", 				WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));	text = wstrappend( tmp, ".\n\nAre you sure you want to remove this palette ?");	free(tmp);	choice = WMRunAlertPanel(scr, panel->win, NULL, text, "Yes", "No", NULL);	/* returns 0 (= "Yes") or 1 (="No") */	free(text);	if (choice == 0) {		tmp = wstrappend(panel->configurationPath, 				WMGetPopUpButtonItem(panel->customPaletteHistoryBtn, item ));		if ( remove(tmp) != 0)			wwarning("Couldn't remove palette %s\n", tmp);		free(tmp);		WMSetPopUpButtonSelectedItem(panel->customPaletteHistoryBtn, item-1);	/* item -1 always exists */		customPaletteHistoryCallback(panel->customPaletteHistoryBtn, panel);		customSetPalette(panel);		WMRemovePopUpButtonItem(panel->customPaletteHistoryBtn, item);	}}