Path: utzoo!attcan!uunet!cs.utexas.edu!uwm.edu!psuvax1!psuvm!alc From: ALC@psuvm.psu.edu Newsgroups: comp.sys.mac.hypercard Subject: Re: supercard problem Message-ID: <90220.120822ALC@psuvm.psu.edu> Date: 8 Aug 90 16:08:22 GMT References: <18200006@ux1.cso.uiuc.edu> Organization: Penn State University Lines: 30 In article <18200006@ux1.cso.uiuc.edu>, cs290ac@ux1.cso.uiuc.edu says: > >I've got a bad supertalk problem. >What I want is to have a scrolling window with two fields inside which, when >clicked at, the line being clicked at changes its text style to bold. >After some digging, I found that I could change the text style of portions >of a field by selecting the desired portion, then changing the text style >of the field. Only the selected portion is affected. Great. >The only problem is that I find out what line was clicked by using a list >field, which apparently doesn't use selections at all. When you select text >in a list field using the select command, nothing happens. I also can't >use regular, non-list fields because I need to find out the line NUMBER being >clicked (I can't use the method of double clicking at the location of the >cursor). The only way I know of finding the line number being clicked at in >a regular field is to use a hypertalk function called clickline. >This won't work because when it tries to get the textheight of the field, >supercard returns "mixed" rather than a number. > >Any help would be greatly appreciated. First, if you are using "List" fields, then you CANNOT make one line bold. By definition, all characters in a list field must have the same attribut es (like font, style, etc). If you want just one line to have a different style, they you have to use standard, scrolling fields. In that case, you will have to compute the clickLine manually by dividing the mousePosition by the textHeight. If your textHeight is returning MIXED, then you either have to hard code in the text height (which is the same number as the font size) or you'll have to select all text in the field, make it plain, and then get the textHeight.