如何获得按钮标签文本的宽度?

时间:2013-07-20 09:49:44

标签: button width livecode

如何将脚本中创建的按钮的宽度设置为其标签文本之一?

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

在LiveCode词典中搜索 width 会显示十几个条目,但似乎没有任何内容适用。

1 个答案:

答案 0 :(得分:3)

试试这个:

将按钮“yourButton”的宽度设置为按钮“yourButton”的formattedWidth

克雷格纽曼

相关问题