Path: utzoo!attcan!uunet!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!sdd.hp.com!elroy.jpl.nasa.gov!ucla-cs!rutgers!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: Selection in TE Message-ID: <13987@unix.SRI.COM> Date: 9 Jul 90 18:41:53 GMT References: <14358@csli.Stanford.EDU> Reply-To: mxmora@unix.UUCP (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 40 In article <14358@csli.Stanford.EDU> weyand@csli.Stanford.EDU (Chris Weyand) writes: >I'm writing an application that selects text (using TextEdit) from >the keyboard (e.g. select word,sentence, ...) There doesn't seem to >be any way of extending a selection without calling TEClick. Is >this correct? The only solution I could come up with was to call TEClick I might be missing the point but why can't you use: TESetSelect(selStart, selEnd, te); If you don't know what the previous selction range is you can do something like: selstart:=te^^.selstart; selEnd:=te^^.selend; {calculate your new offset, being a word, sentance or char} TESetSelect(selStart, selEnd, te); I can't believe Apple didn't include a TEGetSelect call. And I thought Apple was against accessing the data structures directly. Yet in IM vol I pg 377 they state: "Some TextEdit features are available only if you access fields of the edit record directly." Well anyway I hope I anwsered what you were asking. >Anyone have any help? > >Thanks >Chris Weyand >weyand@csli.Stanford.edu -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________