Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: MacApp Question Message-ID: <18716@apple.Apple.COM> Date: 13 Oct 88 16:51:55 GMT References: <250@tekn01.chalmers.se> Organization: Advanced Technology Group, Apple Computer Lines: 32 In article <250@tekn01.chalmers.se> d83_sven_a@tekn01.chalmers.se (Sven (Sciz) Axelsson) writes: > >I have an application in which I want one document that is open all >the time, like the Worksheet in MPW. This should also have a fixed >name. So I call OpenNew in my applications IApplication method which >eventually leads to a call to DoMakeWindows with a window template >with a fixed name (no <<<>>>:s). This sets the window title all right, >but the documents name is still Untitled-1 as can be seen when I try >to save it. Question: Am I missing something simple or is this the >way things are supposed to happen? It is the way things are supposed to happen. The default behavior isto give new documents the Untitled name (although the exact name is in a resource). There is a method called TDocument.UntitledName that is used to generate the name. You could override this for your "Worksheet" document class. If it was just like MPW, then you would want to call OpenOld and pass it the name of the Worksheet file. It sounds like you do have a file that you want to save and reopen. If the file might not exist, then you can still call OpenOld, but can catch the failure that would result and call OpenNew instead. Finally, the document object can override the default name used in the SFPutFile dialog, but overriding TDocument.SFPutParms. Let me know if this answers your question. Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr