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")
$morph40
10000.703487168222703Wikicontroltrue
morph1
morph2
morph3
morph4
10001.1683777557930353Wikicontroltrue
10009.518789619980216Wikicontroltrue
nullfalsetruenullfalse
morphdeffalsenullfalse
false
false
falsenullfalse
localrequirementsfalsetruefalse0false
initializerfalsetruefalse0false
morphdeffalsetruefalse0false340.52nullnulltruetruetrue
1true
null
null
null
nulltruetrue
-----falsetruefalse0false340.5-1nullnulltruetruetrue
1true
null
null
null
nulltruetrue
/*Morph.addMethods({getMorphNamed:function(name){varmorph;for(vari=0;i<this.submorphs.length;i++){morph=this.submorphs[i];if(morph.getName()===name)returnmorph;}for(vari=0;i<this.submorphs.length;i++){morph=this.submorphs[i].getMorphNamed(name);if(morph)returnmorph;}},})WorldMorph.prototype.getMorphNamed=Morph.prototype.getMorphNamed;*/17truetrue2000000truetrue
1truetruetrue
Browseworld...falsenull
Pushchangesbackfalsenull
Refreshfalsenull
Evalonfalsenull
Sortfalsenull
truetruenullfalsenullnullnullnullfalse
nulltrue$morph('morph1')$morph('morph2').getName()$morph('morph4').getName()truetruefalse1truetruefalse
false1truefalsetruetruefalse
nullfalsetruenullfalse
falsenullfalse
false
false
falsenullfalsefalsenullnullnullnullfalsenull48