/* ** Newton Developer Technical Support Sample Code ** ** MinMail, a Newton 2.x transport example ** ** by J. Christopher Bell, Newton Developer Technical Support ** ** Copyright © 1994-7 by Apple Computer, Inc. All rights reserved. ** ** You may incorporate this sample code into your applications without ** restriction. This sample code has been provided "AS IS" and the ** responsibility for its operation is 100% yours. You are not ** permitted to modify and redistribute the source as "DTS Sample Code." ** If you are going to re-distribute the source, we require that you ** make it clear in the source that the code was descended from ** Apple-provided sample code, but that you've made changes. */ SetPartFrameSlot( 'theTransport, GetLayout("MinMailTransport.lyt")); InstallScript := func(partFrame,removeFrame) begin // We created a reference to our protoTransport object using // SetPartFrameSlot. See the "MinMailTransport.t" layout's beforeScript. RegTransport( kAppSymbol, partFrame.theTransport ); RegUnionSoup( kAppSymbol, kMySoupDef ); // If this device has 'text dataDefs installed, we won't need our viewDef! if NOT GetDataDefs('text) then RegisterViewDef(GetLayout("TextViewDef.lyt"), EnsureInternal('text)); end; RemoveScript := func(removeFrame) begin UnRegisterViewDef(kSimpleTextViewDefSym, 'text); UnRegUnionSoup(kSoupName, kAppSymbol); UnRegTransport(kAppSymbol); end; SetPartFrameSlot( 'DeletionScript, func() begin // If the user scrubs out the package, this function will be called. // We do NOT want to do this during debugging because it will be called often. // When you download a new version with NTK, it will delete the old one // and call it's DeletionScript. Note that DeleteTransport removes the preferences // for the transport! Here, you might want to delete your temporary data (in our // case, we might delete our temp soups entirely) if NOT kDebugOn then DeleteTransport(kAppSymbol) end);