Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!uc!nic.MR.NET!umn-cs!bungia!orbit!pnet51!pj From: pj@pnet51.cts.com (Paul Jacoby) Newsgroups: comp.sys.mac.hypercard Subject: Re: "Real" hypertext? Message-ID: <722@orbit.UUCP> Date: 30 Jun 89 01:45:16 GMT Sender: root@orbit.UUCP Organization: People-Net [pnet51], Minneapolis, MN. Lines: 37 Greg, a slightly more elegant approach to selecting the text comes from Apple itself, in a function called 'clickline()'. See below: -- the following function is from the "HyperCard 1.2.2 Release Notes" -- stack --function clickLine returns the line of the target field --over which the mouse was clicked. It allows 4 pixels under the --baseline for the psychological effect of descenders. function clickLine return ((the mouseV - item 2 of the rect of the target-4)B div the textheight of the target) + 1 end clickLine NOTE: That "B" up there is a line continuation character. This works really well in a script like: on mouseUp get clickline() -- find out where they clicked select line it of me -- select the text get the selection if it is empty then -- do whatever end if -- and do whatever else here with the selected text end mouseUp This script goes in the field itself, which needs to be in a 'locked text' state to receive the mouseUp event. Paul .-----------------------------------------------------------------------------. | UUCP: {rosevax, crash, orator}!orbit!pnet51!pj | Working with idiots keeps | | ARPA: crash!orbit!pnet51!pj@nosc.mil | my life interesting... | | INET: pj@pnet51.cts.com | | `-----------------------------------------------------------------------------'