Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!olivea!apple!jdevoto From: jdevoto@Apple.COM (Jeanne A. E. DeVoto) Newsgroups: comp.sys.mac.hypercard Subject: Re: Hypertalk questions for gurus... Message-ID: <48786@apple.Apple.COM> Date: 3 Feb 91 11:09:06 GMT References: <9101292006.aa01354@BONNIE.ICS.UCI.EDU> Organization: Apple Computer Inc., Cupertino, CA Lines: 36 In article <9101292006.aa01354@BONNIE.ICS.UCI.EDU> rhutchin@BONNIE.ICS.UCI.EDU writes: > So I have a table of contents set up with "Chapter" names in one field. > When the user clicks on a line that has the name of the chapter, it > sets the visible of the appropriate field that contains the names of > "sections" in the chapter. But I'd like to keep the chapter name hilighted > in when I write into other fields, so the user can see how they got where > they are. So here's what the problem boils down to: How can I write text > into a field while NOT altering the selected text in another field? Basically, you can't -- you can only have one selection at a time. You have a couple of alternatives: - After each write to a field, re-select the chapter name. This will work better if these writes are under script control, since you can lock the screen before doing your field updates (reducing flickering as the chapter name is selected and deselected). If you're letting users type text into a field, however, the only way to keep the chapter name selected is to use a keyDown handler which places the typed key in the field and then reselects the chapter name. With this solution, the performance is likely to be terrible. - A better solution is to use a transparent button with its hilite set to true. This button can be placed in the proper location under script control, so that it covers and reverse-hilites the appropriate line of the chapter headings field. This is obviously somewhat simpler if the headings field is not a scrolling field (in this case, you can even create a button for each line in the field, and simply turn on the hilite property on mouseDown to hilite the chapter name). -- ========= 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. |