fit content by script - solved

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Christo777
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 13
Joined: Thu Nov 16, 2006 4:34 am

fit content by script - solved

Post by Christo777 » Thu May 24, 2012 3:18 am

Hello,

I need to resize a field according to it's contained text (which I don't know in advance), so all text will be visible without scrollbars. More or less like inspector's "Fit content" in "Size & position".

Thank you
Last edited by Christo777 on Sun Jun 10, 2012 5:47 pm, edited 1 time in total.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: fit content by script

Post by sturgis » Thu May 24, 2012 3:34 am

look at formattedwidth and formattedheight in the dictionary.

set the width of field "myfield" to the formattedwidth of field "myfield" ...

Christo777
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 13
Joined: Thu Nov 16, 2006 4:34 am

Re: fit content by script

Post by Christo777 » Fri May 25, 2012 12:07 am

Thank you, It did work this time.

Post Reply