"args0": [ { "type": "field_input", "name": "EXP_SAVE", "text": "save" },
{ "type": "exp_saved", "message0": "%1", "args0": [ { "type": "field_dropdown", "name": "NAME", "options": [ [ "option", "OPTIONNAME" ] ] } ], "output": null, "colour": 230, "tooltip": "Saved Expressions", "helpUrl": "" }
Blockly.Blocks['exp_saved'] = {
init: function() {
this.appendDummyInput()
// This is where the dynamic dropdown is created.
.appendField(new Blockly.FieldDropdown(this.dynamicOptions), 'NAME');
this.setColour(230);
this.setTooltip("Saved Expressions");
this.setHelpUrl("");
},
// This returns the options for your dynamic dropdown.
dynamicDropdown: function() {
var options = [];
for (var i = 0; i < mySavedExpressionArray.length; i++) {
options.push(mySavedExpressionArray[i], 'OPTION' + i);
}
return options;
}
};--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
var topBlocks = myWorkspace.getTopBlocks();
for (var i = 0; i < topBlocks.length; i++) {
var children = topBlocks[i].getChildren();
for (var i = 0; i < children.length; i++) {
var child = children[i];
// Doing things with child block etc...
}
}