How can I activate the "Fit Content" for field size

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
brucelaidlaw
Posts: 8
Joined: Tue Mar 25, 2008 12:30 pm
Location: Sydney, Australia
Contact:

How can I activate the "Fit Content" for field size

Post by brucelaidlaw » Wed Apr 25, 2018 9:59 am

I have spelling program which plucks a word of any length and puts it into a field. I'd like to shrink (or expand) the width of the field so it just fits the word. At the moment the fields are 250 pixels wide, but a long word may be topped and tailed.

The Fit Content button in the Field Inspector Size field needs to be activated, but I can't see any way of doing this.
My old hypercard stacks are at:
http://www.angelfire.com/ab2/literacy/index.html

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9250
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: How can I activate the "Fit Content" for field size

Post by richmond62 » Wed Apr 25, 2018 10:12 am

Code: Select all

set the width of fld "fff" to the formattedWidth of fld "fff"
set the height of fld "fff" to the formattedHeight of fld "fff"
8)

brucelaidlaw
Posts: 8
Joined: Tue Mar 25, 2008 12:30 pm
Location: Sydney, Australia
Contact:

Re: How can I activate the "Fit Content" for field size

Post by brucelaidlaw » Wed Apr 25, 2018 12:06 pm

Ah, Excellent Richmond62!

Thank you! :D
My old hypercard stacks are at:
http://www.angelfire.com/ab2/literacy/index.html

Post Reply

Return to “Talking LiveCode”