add: if (removed) { if (pop == panel->cmd1P) { WMSetTextFieldText(panel->tit2T, NULL); } }
context: performCommand(WMWidget *w, void *data){    _Panel *panel = (_Panel*)data;    WMPopUpButton *pop = (WMPopUpButton*)w;    proplist_t menuItem = NULL;    proplist_t menu;    int column;    int row;    static int cmdIndex=0;    char *title = NULL;    column = WMGetBrowserFirstVisibleColumn(panel->browser);    if (pop == panel->cmd2P) {	column++;    }    if (column >= WMGetBrowserNumberOfColumns(panel->browser))	return;    menu = getSubmenuInColumn(panel, column);        row = WMGetBrowserSelectedRowInColumn(panel->browser, column);    switch (WMGetPopUpButtonSelectedItem(pop)) {     case CAddCommand:	title = wmalloc(strlen(_("New Command %i"))+6);	sprintf(title, _("New Command %i"), cmdIndex++);	menuItem = PLMakeArrayFromElements(PLMakeString(title),					   PLMakeString("EXEC"),					   PLMakeString(""),					   NULL);	break;     case CAddSubmenu:	title = wstrdup(_("New Submenu"));	menuItem = PLMakeArrayFromElements(PLMakeString(title),					   NULL);	break;     case CAddExternal:	title = wstrdup(_("External Menu"));	menuItem = PLMakeArrayFromElements(PLMakeString(title),					   PLMakeString("OPEN_MENU"),					   PLMakeString(""),					   NULL);	break;     case CAddWorkspace:	title = wstrdup(_("Workspaces"));	menuItem = PLMakeArrayFromElements(PLMakeString(title),					   PLMakeString("WORKSPACE_MENU"),					   NULL);	WMSetPopUpButtonItemEnabled(panel->cmd1P, CAddWorkspace, False);	WMSetPopUpButtonItemEnabled(panel->cmd2P, CAddWorkspace, False);	break;     case CRemove:	if (row < 0)	    return;	WMRemoveBrowserItem(panel->browser, column, row);	menuItem = PLGetArrayElement(menu, row+1);	if (strcmp(getItemCommand(menuItem), "WORKSPACE_MENU")==0) {	    WMSetPopUpButtonItemEnabled(panel->cmd1P, CAddWorkspace, True);	    WMSetPopUpButtonItemEnabled(panel->cmd2P, CAddWorkspace, True);	}	PLRemoveArrayElement(menu, row+1);	PLRelease(menuItem);	updateForItemType(panel, TNothing);	panel->editedItem = NULL;	panel->unsaved = 1;	return;     case CCut:	if (row < 0)	    return;	if (panel->itemClipboard 	    && strcmp(getItemCommand(panel->itemClipboard), "WORKSPACE_MENU")==0){	    WMSetPopUpButtonItemEnabled(panel->cmd1P, CAddWorkspace, True);	    WMSetPopUpButtonItemEnabled(panel->cmd2P, CAddWorkspace, True);	}	if (panel->itemClipboard)	    PLRelease(panel->itemClipboard);	WMRemoveBrowserItem(panel->browser, column, row);	menuItem = PLGetArrayElement(menu, row+1);	PLRemoveArrayElement(menu, row+1);	updateForItemType(panel, TNothing);		panel->itemClipboard = menuItem;	WMSetPopUpButtonItemEnabled(panel->cmd1P, CPaste, True);	WMSetPopUpButtonItemEnabled(panel->cmd2P, CPaste, True);	panel->unsaved = 1;	return;	     case CCopy:	if (row < 0)	    return;	if (panel->itemClipboard 	    && strcmp(getItemCommand(panel->itemClipboard), "WORKSPACE_MENU")==0){	    WMSetPopUpButtonItemEnabled(panel->cmd1P, CAddWorkspace, True);	    WMSetPopUpButtonItemEnabled(panel->cmd2P, CAddWorkspace, True);	}	if (panel->itemClipboard)	    PLRelease(panel->itemClipboard);	panel->itemClipboard = NULL;	menuItem = PLGetArrayElement(menu, row+1);	if (strcmp(getItemCommand(menuItem), "WORKSPACE_MENU")==0)	    return;	panel->itemClipboard = PLDeepCopy(menuItem);		WMSetPopUpButtonItemEnabled(panel->cmd1P, CPaste, True);	WMSetPopUpButtonItemEnabled(panel->cmd2P, CPaste, True);	return;     case CPaste:	menuItem = panel->itemClipboard;	title = wstrdup(getItemTitle(menuItem));	panel->itemClipboard = NULL;	WMSetPopUpButtonItemEnabled(panel->cmd1P, CPaste, False);	WMSetPopUpButtonItemEnabled(panel->cmd2P, CPaste, False);		break;    }    if (row>=0) row++;    WMInsertBrowserItem(panel->browser, column, row, title, isMenu(menuItem));    if (row<0)	PLAppendArrayElement(menu, menuItem);    else	PLInsertArrayElement(menu, menuItem, row+1);    free(title);    panel->unsaved = 1;}