Resizing a Text Field Dynamically, While Locking Its XY Coordinates

Sarah Reichelt sarah.reichelt at gmail.com
Tue Jan 13 17:30:23 EST 2009


> I'm experimenting with just the left text field and grabber icon at this
> time.  My current challenge is that when I drag the grabber, the text field
> on the left resizes in width-- however, it resizes from its centerpoint
> outwards.  Ideally, I would want the text field's XY coordinates to remain
> locked, while the right side of the text field resizes.
>
> Is there a property for Rev objects that can configure objects to resize
> from one specific side?


I adjust the rect of the object to do this. The rect has the four
points of the object: left, top, right, bottom.
A mnemonic for this that I was told once is "LiTteR Bug".

Here is an example which increases the width of a field by 10 pixels,
while keeping the topLeft of the field in the same place:

put the rect of fld "My Field" into tRect
add 10 to item 3 of tRect
set the rect of fld "My Field" to tRect

HTH,
Sarah



More information about the use-livecode mailing list