public WorkbenchView CreateWorkbenchView()
 {
     WorkbenchView view = new WorkbenchView (controller);
     views.Add (view);
     activeView = view;
     Logger.Debug ("Created new top level view");
     return view;
 }
 public void DeclareParentViewActive(object obj)
 {
     activeView = null;
     Widget widget = obj as Widget;
     Logger.Assert (widget != null, "object is not a widget");
     Gtk.Widget window = GetToplevelWidget (widget);
     foreach (WorkbenchView view in views) {
         if (window == view.Window) {
             activeView = view;
             Logger.Debug ("Found active view for " +
                       obj.GetType() +
                       " : " +
                       view.Window.Title);
             return;
         }
     }
     Logger.Debug ("Did not find the active view");
 }
        public void RemoveWorkbenchView(WorkbenchView view)
        {
            if (view == null) {
                Logger.Debug ("Active window is null - cannot remove");
                return;
            }
            if (views.Count == 1) {
                Quit ();
            } else {
                views.Remove (view);
                Logger.Debug ("Removed view " + view.Window.Title);
                view.Window.Destroy ();
                Logger.Debug (views.Count + " views left");

            }
        }