private void OnDestroy() { GameEvents.onLaunch.Remove(OnLaunch); GameEvents.onFlightReady.Remove(OnFlightReady); toolbar?.Destroy(); Debug.Log($"[QuickIronMan]({name}) Destroy"); }
private void BuildToolbars(IWorkspace workspace) { _toolBarBox.Remove(_toolBar); _toolBar.Destroy(); // make sure the old one is cleaned up! _toolBar = new Toolbar(); _toolBar.ToolbarStyle = ToolbarStyle.Icons; _toolBarBox.PackStart(_toolBar, true, true, 0); _tooltips = new Tooltips(); ActionModelRoot model = new ActionModelRoot(""); //model.Merge(WorkstationModel.ToolManager.ToolbarModel); model.Merge(DesktopApplication.ToolSet.ToolbarModel); if (workspace != null) { //model.Merge(workspace.ToolManager.ToolbarModel); model.Merge(workspace.ToolSet.ToolbarModel); } GtkToolbarBuilder.BuildToolbar(_toolBar, _tooltips, model); _toolBar.ShowAll(); }