method add_view v =
      match contents with
        None ->
          init_view (self :> Ed_view.topwin) v;
          self#set_contents (Some (`View v));
      | Some ((`View _) as current_c)
      | Some ((`Paned _) as current_c) ->
          
          (** TODO: whether a paned or notebook is created should be a choice in preferences *)

          let gn = new gui_notebook (self :> Ed_view.topwin) () in
          self#set_contents (Some (`Notebook gn));
          gn#add_tab None current_c;
          gn#add_view v
      | Some (`Notebook gn) ->
          gn#add_view v