Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: Clicking on Fields Summary: the selectedLine, the clickLine Message-ID: <47341@apple.Apple.COM> Date: 13 Dec 90 10:27:41 GMT References: <195@anaxagoras.ils.nwu.edu> Organization: Apple Computer Inc., Cupertino, CA Lines: 41 In article <195@anaxagoras.ils.nwu.edu> korcuska@plato (Michael Korcuska) writes: > [ . . ] we have a field which, according to hypercard, has 3 lines >but occupies 4 or 5 physical lines on the screen. How can we find out which >of the 3 lines was clicked? Assuming the field is locked, in HyperCard 1.2.2 or 1.2.5: on mouseDown set the lockText of the target to false click at the clickLoc get word 2 of the selectedLine -- the line number clicked on set the lockText of the target to true -- do something with the line number end mouseDown In HyperCard 2.0: on mouseDown get word 2 of the clickLine -- the number of the line clicked on -- do something with the line number end mouseDown If the field is not locked, generally an idle handler at the card level or higher works best: on idle global lastLineClicked if the selectedLine is lastLineClicked then pass idle -- hasn't changed put the selectedLine into lastLineClicked if the selectedField is "card field 1" then -- do something with the line number -- word 2 of the selectedLine end if end idle -- ========= jeanne a. e. devoto ======================================== jdevoto@apple.com | You may not distribute this article under a jdevoto@well.sf.ca.us | compilation copyright without my permission. ______________________________________________________________________ Apple Computer and I are not authorized | CI$: 72411,165 to speak for each other. |