jmoenig/Snap--Build-Your-Own-Blocks — pull request #641 by bromagosa (2014-11-17 13:12:56+00:00)
Title: Added callback to Process

Added a callback to Process, which is executed once the process is done.

It takes the block's result as a parameter, which may eventually be null if the block is not a reporter.

You can test it by adding a test menu item to *BlockMorph.prototype.userMenu*, such as:

```
menu.addItem(
"callback test",
function() {
var top = this.topBlock(),
receiver = top.receiver(),
stage;
if (top !== this) {return; }
if (receiver) {
stage = receiver.parentThatIsA(StageMorph);
if (stage) {
stage.threads.stopProcess(top);
stage.threads.startProcess(top, false, true, function(result) { alert(result) });
}
}
}
);
```