Lively Kernel canvas
// this script is evaluated on world load
MyConsole = WorldMorph.current().submorphs.detect(function(ea){return ea.name == "MyConsole"});
if(!MyConsole) return;
MyConsole = MyConsole.component;
MyConsole.setText("-- start --");
MyConsole.log = function(s) {
this.setText(this.formalModel.getText() + "\n" + s);
};
MyConsole.log("My Console initialized!");
MyConsole.morph.resetScrollPane = function() {
var sp = this.enclosingScrollPane();
if (sp) sp.scrollToBottom();
};
// console.consumers seems to be broken... so we go the hard waz
console.log = console.log.wrap(function(proceed, s) {
MyConsole.log(s)
proceed(s)})
console.log("wrapped console for MyConsole successfully")
createLayer("MyLayer");Object.subclass('MyClass',{initialize:function(){this.a=7;this.b="Hello";},getMyLayer$a(proceed){returnthis._MyLayer_a;},setMyLayer$a(proceed,v){this._MyLayer_a=v;},getMyLayer$b(proceed){if(!proceed)return;returnproceed()+"World";}});1617
10000.01834107395124954Wikicontroltrue
o=newMyClass();o.a;//7o.b//"World"withLayers([MyLayer],function(){o.a=9;});o.a;//7withLayers([MyLayer],function(){console.log(o.a);//9console.log(o.b)//"HelloWorld"});1615
10004.457821649945624Wikicontroltrue
LayerStatewithContextJS40
-----falsetruefalse0false
Clipboardactionnotsuccessfulfalsetruefalse0
fontHelvetica40:spacewidth11from51xWidth20falsetruefalse0
ResizingSVGcanvasfalsetruefalse0
-------------------------------------------falsetruefalse0
invoke3782:TextMorph([5,-4,472,53])falsetruefalse0
-------------------------------------------falsetruefalse0
invoke484:TextMorph([0,0,441,310.3333435058594])falsetruefalse0
computingwheelfor49falsetruefalse0
gotselectionsimplefalsetruefalse0
computingwheelfor49falsetruefalse0
computingwheelfor49falsetruefalse0
computingwheelfor49falsetruefalse0
fontCourier16:spacewidth10from30xWidth10falsetruefalse0
-------------------------------------------falsetruefalse0
invoke6603:TextMorph([0,0,441,276.73333740234375])falsetruefalse0
computingwheelfor49falsetruefalse0
gotselectionsimplefalsetruefalse0
computingwheelfor49falsetruefalse0
computingwheelfor49falsetruefalse0
computingwheelfor49falsetruefalse0
-------------------------------------------falsetruefalse0
invoke1:WorldMorph([0,0,1261,679])falsetruefalse0
status200onGEThttp://lively-kernel.org/repository/webwerkstatt/LayerStateExample.xhtml?1259659792825falsetruefalse0
extendForSerializationundefinedfalsetruefalse0803-1nulltrue0falsetruetruefalse
false1truefalse
nullfalse
nullfalse
nullfalse
nullfalsefalsetruetruefalse
true100false
true050false
nullfalsetruenullfalse
Consolefalsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalsenull11