using keyUp to update a fld's style

Jan Schenkel janschenkel at yahoo.com
Thu Feb 27 01:14:01 EST 2003


--- Terry Judd <tsj at unimelb.edu.au> wrote:
> >--- Terry Judd <tsj at unimelb.edu.au> wrote:
> >>  Hi all - I'm using a keyUp handler to toggle an
> >>  editable fld's style
> >>  between plain and scrolling according to it's
> >>  contents by comparing
> >>  the fld's textHeightSum() and height which all
> works
> >>  fine except when
> >>  the return and delete (or backspace) keys are
> >>  involved. I've tried
> >>  trapping these separately using the returnKey
> (or
> >>  whatever) message
> >>  with no apparent result.
> >>
> >>  Any clues on how best to proceed?
> >>  --
> >>  Dr Terry Judd
> >>
> >
> >Hi Terry,
> >
> >Have a look at the entries for the 'rawKeyDown' and
> >'rawKeyUp' messages in the Transcript Dictionary.
> >
> >Hope this helped,
> 
> Indeed it did - thanks Jan!
> 
> >Jan Schenkel.
> 
> Perfect!!
> -- 
> Dr Terry Judd
> 

In this case, I think you can do it as simple as:

on rawKeyUp pWhichKey
  set the vScrollbar of me to \
     (the formattedHeight of me > the height of me)
  pass rawKeyUp
end rawKeyUp

Hope this helped,

Jan Schenkel.

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/



More information about the use-livecode mailing list