Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!think.com!hsdndev!husc6!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Exporting Styled Text Inf Message-ID: <20587@unix.SRI.COM> Date: 30 Jan 91 17:52:57 GMT References: <3215.27A6A774@blkcat.fidonet.org> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 45 In article <3215.27A6A774@blkcat.fidonet.org> Ken.Knight@f421.n109.z1.fidonet.org (Ken Knight) writes: >I'm asking this for a friend, but please send replies to this address. > >I need to save styled TextEdit information to disk. That means, the >TERecord and its associated Style reocrd along with the text itself. You should get the book "Programming the Macintosh II" by David a Wilson. It comes with source code examples on how to do what you want. This book looks like its just viewgrafs from a seminar he gave but the source is usefull. I think what you need to do is save three parts of the style records seperatly. Below is an example. To save a style record: styleRecHdl := GetStylHandle(textH); styleTableHdl := styleRecHdl^^.styleTab; lhTableHdl := styleRecHdl^^.lhTab; To restore a style record: SetStylHandle(styleRecHdl, textH); styleRecHdl^^.styleTab := styleTableHdl; styleRecHdl^^.lhTab := lhTableHdl; -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@QM.SRI.COM SRI International | my SUN mxmora@unix.sri.com ___________________________________________________________