model_server/gala/src/viewerMenu.cxx
// Cleans out all of the items in the menu.
Cleans out all of the items in the menu.
Cleans out all of the items in the menu .
void ViewerAppMenu::PurgeItemList()
{
    if (persistent < 0)
	persistent = GetItemCount();
    for (int iter = GetItemCount(); iter>persistent; iter--) {
        vmenuItem* i = GetItemAt(iter-1);
        DeleteItem(i);
        i->DeleteLater();
    }
    if (persistent <= 0) {
	if (myItemList_) {
	    myItemList_->DestroyList();
	    delete myItemList_;
	    myItemList_ = NULL;
	}
	oldListItem_ = NULL;
    } else {
	for (oldListItem_ = myItemList_;
	     oldListItem_->GetNext() != NULL; 
	     oldListItem_ = oldListItem_->GetNext()) ;
    }
}
void ViewerAppMenu :: PurgeItemList ( ) { if ( persistent < 0 ) persistent = GetItemCount ( ) ; for ( int iter = GetItemCount ( ) ; iter > persistent ; iter -- ) { vmenuItem * i = GetItemAt ( iter - 1 ) ; DeleteItem ( i ) ; i -> DeleteLater ( ) ; } if ( persistent <= 0 ) { if ( myItemList_ ) { myItemList_ -> DestroyList ( ) ; delete myItemList_ ; myItemList_ = NULL ; } oldListItem_ = NULL ; } else { for ( oldListItem_ = myItemList_ ; oldListItem_ -> GetNext ( ) != NULL ; oldListItem_ = oldListItem_ -> GetNext ( ) ) ; } }
Cleans out all of the items in the menu.
Cleans out all of the items in the menu .
// -- remember all persistent items // First delete all of the attached items. // Note - This only works because this menu never has sub-menus. // Now delete the item list.