Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!stanford.edu!unix!mxmora From: mxmora@unix.SRI.COM (Matt Mora) Newsgroups: comp.sys.mac.programmer Subject: Re: EditText question Message-ID: <23773@unix.SRI.COM> Date: 30 Apr 91 16:13:44 GMT References: <1991Apr30.010156.4752@uokmax.ecn.uoknor.edu> Reply-To: mxmora@unix.sri.com (Matt Mora) Organization: SRI International, Menlo Park, CA Lines: 46 In article <1991Apr30.010156.4752@uokmax.ecn.uoknor.edu> kpmiller@uokmax.ecn.uoknor.edu (Kent P Miller) writes: >I have some source code that looks like this: > >TESetSelect(0, 300, TE_Edit_Text); >TEDelete(TE_Edit_Text); >TEUpdate(TE_Rect_Edit_Text, TE_Edit_Text); >TESetText(@st[1], length(st), TE_Edit_Text); > >This usually works fine. But, if I select a little part of the text before >this code gets executed, The text gets screwed up when it gets pumped into >the area. For instance, if I try to pump in the a string, and I select some >of the original text in the area first, the first 4 characters are invisible. >What am I doing wrong? Let me see if I understand what you are trying to do: >TESetSelect(0, 300, TE_Edit_Text); select chars 0-300 >TEDelete(TE_Edit_Text); delete selected chars >TESetText(@st[1], length(st), TE_Edit_Text); set the te to hold the data in st. What you might want to try is: TESetSelect(0, 300, TE_Edit_Text); TEDelete(TE_Edit_Text); TESetText(@st[1], length(st), TE_Edit_Text); TECalText( TE_Edit_Text); EraseRect(TE_Rect_Edit_Text); TEUpdate(TE_Rect_Edit_Text, TE_Edit_Text); That might solve your problem. -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________