Page 1 of 1

Dynamically changing text field height

Posted: Wed Dec 21, 2011 11:37 am
by ewansmac
I am trying to develop my first Livecode application and I need to vary the field height as I change the width of my stack. The text in the field changes from three to four lines and I want the overall height of the field to increase and decrease as the number of lines increases and decreases. Is there a way to find how many lines are in a field?

Regards,

ewansmac

Re: Dynamically changing text field height

Posted: Wed Dec 21, 2011 12:14 pm
by jmburnod
Hi EwansMac,

And welcome to this forum
Is there a way to find how many lines are in a field?
Effectives lines (with return char) or visibles lines ?
For effectives lines use the num of lines of ffld "myField"

For visibles lines you can get the height of the text of the field
check "formattedHeight" in LC dictionary. It explane better than me :oops:

Best regards

Jean-Marc

Re: Dynamically changing text field height

Posted: Wed Dec 21, 2011 4:49 pm
by Dixie
Ewansmac...

I've got the general idea of what you wish to do... I think :D
I have attached a stack for you to look at... have a look at the card script and the geometry settings of fld 1

hope it helps...

Dixie

Re: Dynamically changing text field height

Posted: Wed Dec 21, 2011 5:01 pm
by dunbarx
You must play with the several points raised by your responders. The difference between hard delimited lines and wrapped lines is key here. Make sure you are comfortable with that subtle but important distinction.

So your field expands when the stack width does?