Skip to content

Commit f8c09e1

Browse files
committed
Make headless models update their view when they do stuff
1 parent a4b45fe commit f8c09e1

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/main/HeadlessChildModel.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import org.nlogo.api.*;
88
import org.nlogo.headless.HeadlessWorkspace;
9+
import org.nlogo.nvm.HaltException;
910
import org.nlogo.workspace.AbstractWorkspace;
1011

1112
public class HeadlessChildModel extends ChildModel {
@@ -50,6 +51,19 @@ public void updateView() {
5051
}
5152
}
5253

54+
@Override
55+
public void ask(String command, Object[] actuals) throws ExtensionException, HaltException {
56+
super.ask(command, actuals);
57+
updateView();
58+
}
59+
60+
@Override
61+
public Object of(String reporter, Object[] actuals) throws ExtensionException, HaltException {
62+
Object result = super.of(reporter, actuals);
63+
updateView();
64+
return result;
65+
}
66+
5367
@Override
5468
public AbstractWorkspace workspace() {
5569
return myWS;

0 commit comments

Comments
 (0)