0

In my toolbox.xml I have created a custom block by concatenating multiple blocks, something like

<block type="my_custom_type">
    <value name="LIST_REQUIRED">
        <block type="lists_create_with" inline="true">
            <mutation items="3"></mutation>
            <value name="ADD0">
                <block type="get_variable"/>
            </value>
            <value name="ADD1">
                <block type="get_variable"/>
            </value>
            <value name="ADD2">
                <block type="get_variable"/>
            </value>
        </block>
    </value>
</block>

in this specific case, a list block is united with my_custom_type block.

After an user drags this new block to the workspace, how do I prevent him from removing the "list" block from the original "my_custom_type" block? At the moment he can do that by clicking on the "list" block, which allows him to take that piece separately.

Emanuel
  • 1,333
  • 1
  • 10
  • 11

1 Answers1

0

You can set by attributes in block xml for child blocks , you may try like this

<block type="my_custom_type">
    <value name="LIST_REQUIRED">
        <block type="lists_create_with" inline="true" deletable="false" movable="false">
            <mutation items="3"></mutation>
            <value name="ADD0">
                <block type="get_variable"/>
            </value>
            <value name="ADD1">
                <block type="get_variable"/>
            </value>
            <value name="ADD2">
                <block type="get_variable"/>
            </value>
        </block>
    </value>
</block>
Sethuraman
  • 654
  • 6
  • 15