0

How can I set the width of a button created in a script to the one of its label text?

on createButtonWithLabel aLabel
   create button
   set the label of it to aLabel
   -- set the width of the button to the space used by 'aLabel'
   -- ??
end createButtonWithLabel

searching for width in the LiveCode dictionary brings up more than a dozen entries but nothing seems to apply.

z--
  • 2,186
  • 17
  • 33

1 Answers1

3

Try this:

set the width of button "yourButton" to the formattedWidth of button "yourButton"

Craig Newman

dunbarx
  • 146
  • 2