z--*_*z-- 0 user-interface field livecode
我想通过代码创建一组字段.
create group
set the name of it to "myGroup"
create field
set the name of it to "myField"
set the top of field "myField" to 10
set the width of field "myField" to 100
set the left of field "myField" to 20
-- add myField to myGroup
-- ??
set the backgroundBehavior of group "myGroup" to true
Run Code Online (Sandbox Code Playgroud)
问题
小智 5
要向组添加字段:
create field "myField" in group "thisGroup"
Run Code Online (Sandbox Code Playgroud)
然后,您可以正常设置其他属性.您也可以单独设置名称,但将其包含在"create"命令中很方便.
要将现有组添加到当前卡:
place group "myGroup" onto this card
Run Code Online (Sandbox Code Playgroud)
您可以将任何卡片参考替换为"此卡".请注意,新创建的任何组都会自动放在当前卡上."place"命令仅用于显示当前卡上另一张卡的组.
要查看当前卡上是否有组:
get there is a group "myGroup" of this card
Run Code Online (Sandbox Code Playgroud)
您可以将任何卡片参考替换为"此卡".