private void _mainWidget_Destroyed(object sender, System.EventArgs e) { profileGrid.MainWidget.Destroy(); profileGrid = null; propertyGrid.MainWidget.Destroy(); propertyGrid = null; graph.MainWidget.Destroy(); graph = null; mainWidget.Destroyed -= _mainWidget_Destroyed; owner = null; }
public ProfileView(ViewBase owner) : base(owner) { Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.ProfileView.glade"); vpaned1 = (VPaned)builder.GetObject("vpaned1"); vpaned2 = (VPaned)builder.GetObject("vpaned2"); vbox1 = (VBox)builder.GetObject("vbox1"); mainWidget = vpaned1; propertyGrid = new GridView(this); vbox1.PackStart(propertyGrid.MainWidget, true, true, 0); //vpaned1.Pack1(PropertyGrid.MainWidget, true, true); profileGrid = new FormattedGridView(this); profileGrid.NumericFormat = "N3"; vpaned2.Pack1(profileGrid.MainWidget, true, true); graph = new GraphView(this); vpaned2.Pack2(graph.MainWidget, true, false); graph.MainWidget.Realized += GraphWidget_Realized; mainWidget.Destroyed += _mainWidget_Destroyed; }