Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!pasteur!agate!violet.berkeley.edu!edmoy From: edmoy@violet.berkeley.edu Newsgroups: comp.sys.mac.hypercard Subject: Re: Select line from a field when textLocked Message-ID: <7039@agate.BERKELEY.EDU> Date: 18 Feb 88 19:03:06 GMT References: <993@cadre.dsl.PITTSBURGH.EDU> Sender: usenet@agate.BERKELEY.EDU Reply-To: edmoy@violet.berkeley.edu.UUCP () Organization: University of California, Berkeley Lines: 29 In article <993@cadre.dsl.PITTSBURGH.EDU> geb@cadre.dsl.pittsburgh.edu.UUCP (Gordon E. Banks) writes: >I would like to be able to select an entire line from a text field >by clicking on the line with the browse tool. I figured out >how to select any word (sending two clicks at the mouseloc when >click occurs), but have had trouble selecting an entire line. >Using the rect coordinates and dragging the mouse doesn't seem >to work for some strange reason. Can anyone help? I remember having problem a similar problem with dragging the mouse over a line of text, trying to select it. I could get it to work either. Fortunately, there is another way. Let x1 be the left side of the line, x2 the right side, and y the vertical position of some spot in the line. Then use: click at x1,y click at x2,y with shiftKey This is the old extend-selection-with-shift-key trick. One other note. If you got x2 from the rect of the field, then you need the subtract a pixel of two from it to make sure the coordinate is really within the boundaries of the field. Edward Moy Workstation Software Support Group University of California Berkeley, CA 94720 edmoy@violet.Berkeley.EDU ucbvax!violet!edmoy