Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!bloom-beacon!apple!apple.com!shebanow From: shebanow@apple.com (Andrew Shebanow) Newsgroups: comp.sys.mac.programmer Subject: Re: System 7.0 question Message-ID: <2402@internal.Apple.COM> Date: 18 Jun 89 23:22:19 GMT Sender: usenet@Apple.COM Organization: Apple Computer, Inc. Lines: 35 References:<964@cnetlu.UUCP> <119@dbase.UUCP> In article <119@dbase.UUCP> awd@dbase.UUCP (Alastair Dallas) writes: > program. Then user deletes paragraph containing graph. Then the graph > program reports a change in the graph to the system. At this point, the wp > app's view of the document is out of date. The wp app asks the system if > anything has changed, the system mentions the graph, and the wp app modifies > its private undo scrap. Now the user says Undo. Result: the updated > graph is replaced. Magic. But the point is, the wp app is in charge--it > decides when to ask the system about updates and it decides what to do > with updates when it gets them. Close, but the wp application doesn't really "ask" for changes - it receives a "publication changed" event in its normal event loop, and it can either process it immediately or save the information for later use, as long as it accepts the event (using the AcceptHighLevel event call) immediately. The important point is still true: the application decides when it will update the document containing the subscription, and whether or not the previous command is undoable. The model should be that the subscription data isn't part of the document, but that the "frame" (that is, the subscription info itself) that holds the data is: anything that the user changes about the frame (resizing it, turning off updates for it, etc) should be done as a command, and it should commit the previous command. When the application changes the contents of the frame in response to a "publication changed" method, it should mark the document dirty, but it should not render the previous command non-undoable. In MacApp, this simply means that you should avoid generating a TCommand object to process these events. Have fun, Andrew Shebanow Macintosh Developer Technical Support Disclaimer: these opinions are mine, and mine alone, and should not be taken as official Apple gospel on IAC.