From koffice Mon Jun 27 10:26:49 2005 From: David Faure Date: Mon, 27 Jun 2005 10:26:49 +0000 To: koffice Subject: Re: New document problems Message-Id: <200506271226.49513.faure () kde ! org> X-MARC-Message: https://marc.info/?l=koffice&m=111986802007281 On Monday 27 June 2005 12:23, Boudewijn Rempt wrote: > On Monday 27 June 2005 12:20, David Faure wrote: > > > This is a new requirement for kofficecore indeed, but I'm sure we can put > > together a method to do this. Do you want the new document to be in a new > > KoMainWindow ? > > Yes, I think so. Just like when you choose New in the file menu. > > > AFAICS all you need is > > > > KoDocument* newdoc = myMainWindow->createDoc(); // or duplicate the > > 3 lines there KoMainWindow *win = new KoMainWindow( newdoc->instance() ); > > win->show(); > > win->setRootDocument( newdoc ); > > > > (The view stuff happens in setRootDocument automatically, you only need to > > care about document and mainwindow). > > That looks doable -- but doesn't createDoc() call the template dialog and all > that? No, that's initDoc(), which the above doesn't call. You'll have to initialize the document yourself, of course. -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org). ____________________________________ koffice mailing list koffice@kde.org To unsubscribe please visit: https://mail.kde.org/mailman/listinfo/koffice