model_server/gala/src/view.cxx
// ~View - Desctuctor for the View class.
// It recursively deletes all of its children, removes its pane (and sash),
//    it then deletes its TCL interpreter.
~View - Desctuctor for the View class.
It recursively deletes all of its children, removes its pane (and sash),
it then deletes its TCL interpreter.
~View - Desctuctor for the View class . It recursively deletes all of its children removes its pane ( and sash ) it then deletes its TCL interpreter .
View::~View() 
{
    View* v = ChildView;
    while (v) {
        delete v;         
        v = ChildView;    
    }
    Layer* l = GetLayer();
    if (l) l->setView(NULL);
    layerStack* ls = Layer::getList();
    for (int i = 0; i < ls->size(); i++) {
        Layer *lp = (*ls)[i];
        if (lp->getView() == this) lp->setView (NULL);
    }
    RemovePane();    
    RemoveSash();
    if (RightView) {
         RightView->RemoveSash();
    }
    if (LeftView) {
        LeftView->RemoveSash();
    }
    if (myViewer->layerViews == this)
        myViewer->layerViews = RightView;
    if (myOwnerPane) {
        if (RightView)
            RightView->myOwnerPane = myOwnerPane;
        myOwnerPane->childViewTree_ = RightView;
        myOwnerPane = NULL;
    }
    if (ParentView && ParentView->ChildView == this) {
        ParentView->ChildView = RightView;
    }
    if (LeftView) {
        if (ParentView && ParentView->view_type == HorizontalGroupView)
            LeftView->SetRight(myRect.x + myRect.w);
        else if (ParentView && ParentView->view_type == VerticalGroupView)
            LeftView->SetBottom(myRect.y);
        LeftView->RightView = RightView;
        LeftView = NULL;
    }
    if (RightView) {
        if (ParentView && ParentView->view_type == HorizontalGroupView)      
            RightView->SetLeft(myRect.x);
        else if (ParentView && ParentView->view_type == VerticalGroupView)      
            RightView->SetTop(myRect.y + myRect.h);
        RightView->LeftView = LeftView;
        RightView = NULL;
    }
    Viewer* exViewer;
    View* exView;
    Viewer::GetExecutingView(exViewer, exView);
    if (exView != this) {
        Tcl_InterpDeleteEvent *e = new Tcl_InterpDeleteEvent;
        e->SetClientData (myInterp);
        e->Post();
    }
}
View :: ~ View ( ) { View * v = ChildView ; while ( v ) { delete v ; v = ChildView ; } Layer * l = GetLayer ( ) ; if ( l ) l -> setView ( NULL ) ; layerStack * ls = Layer :: getList ( ) ; for ( int i = 0 ; i < ls -> size ( ) ; i ++ ) { Layer * lp = ( * ls ) [ i ] ; if ( lp -> getView ( ) == this ) lp -> setView ( NULL ) ; } RemovePane ( ) ; RemoveSash ( ) ; if ( RightView ) { RightView -> RemoveSash ( ) ; } if ( LeftView ) { LeftView -> RemoveSash ( ) ; } if ( myViewer -> layerViews == this ) myViewer -> layerViews = RightView ; if ( myOwnerPane ) { if ( RightView ) RightView -> myOwnerPane = myOwnerPane ; myOwnerPane -> childViewTree_ = RightView ; myOwnerPane = NULL ; } if ( ParentView && ParentView -> ChildView == this ) { ParentView -> ChildView = RightView ; } if ( LeftView ) { if ( ParentView && ParentView -> view_type == HorizontalGroupView ) LeftView -> SetRight ( myRect . x + myRect . w ) ; else if ( ParentView && ParentView -> view_type == VerticalGroupView ) LeftView -> SetBottom ( myRect . y ) ; LeftView -> RightView = RightView ; LeftView = NULL ; } if ( RightView ) { if ( ParentView && ParentView -> view_type == HorizontalGroupView ) RightView -> SetLeft ( myRect . x ) ; else if ( ParentView && ParentView -> view_type == VerticalGroupView ) RightView -> SetTop ( myRect . y + myRect . h ) ; RightView -> LeftView = LeftView ; RightView = NULL ; } Viewer * exViewer ; View * exView ; Viewer :: GetExecutingView ( exViewer , exView ) ; if ( exView != this ) { Tcl_InterpDeleteEvent * e = new Tcl_InterpDeleteEvent ; e -> SetClientData ( myInterp ) ; e -> Post ( ) ; } }
~View - Desctuctor for the View class.
~View - Desctuctor for the View class .
//    fprintf(stderr, "Start of ~View:\n"); //    print(0); // Delete all my children. // Recursively delete kids. // The delete will update ChildView. // Update the View's Layer. // Update any layers on the layer stack // Delete my sash and pane. // Note - this should be after removeFromView. // Update view list. // Update owner pane. // Update parent. // Update left neighbor. // See if we need to adjust a group. // Update right neighbor. // See if we need to adjust a group. // Delete my interpreter. //    print(0); //    fprintf(stderr, ":End of ~View\n");