ClickText In a List Field

TBleiler at aol.com TBleiler at aol.com
Tue Sep 10 15:05:00 EDT 2002


>Even easier is to check the clickText, which will return empty if you don't
>click on a line of text, and will return the text of the line you clicked
>(even if you click on spaces between words in a line). I traditionally
>trap
>this to deselect any selections in the field. Note you have trap this in
>a
>*mouseDown* and not a *mouseUp*, otherwise it won't work:
>
>on mouseDown
>  if the clickText is empty then
>    set the hilitedLines of me to ""
>  else
>    -- do something related to clicking on an actual list line, or ignore
>  end if
>end mouseDown
>

Definitely easier but doesn't do the same thing for fields with ListBehavior 
set to true, if the textHeight is something greater than a "single" line. 
ClickText will not return empty when you click the space that appears to be 
between the lines. The function I posted earlier will return empty if you 
click between the lines and return the nearest line number when you click 
right on the text in the line.  I'll admit this is being rather picky and may 
not even be appropriate in some situations, but it's what I need to do 
sometimes.

--Tim Bleiler



More information about the metacard mailing list