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")
ContextJS-Ideas40
IdeasforDebugMorph-logevents-enhancemenuentries-displayboundaries,shownumbers-displayproperies162
LayerIdeas-changestyle(font,fontsize,colors)accordingtoaobject-specificscopeoflayers...->problem,becauseitisimplementedwithstatenotbehavior,wecanlayerstatebutnotifthestateisinahiddensubobjectlikeanrawNode16 problem, because it is implemented with state not behavior, we can layer state but not if the state is in a hidden subobject like an rawNode "]]>
UseLayerswhenrunningTestCases-alayercanbedynamicallyscopedaroundtherun:method-classesanobjectscanbeadaptedtomockrequiredbehavior-onthedownside:thelayeredmethodshavethenanoverheadevenifnotestisrunning...->layerinstallation,layeractivation,layerdeactivation,layerdeinstalltion.164 layer installation, layer activation, layer deactivation, layer deinstalltion."]]>
10007.947167472448606Wikicontroltrue
SyntaxExperimentslayerClassalternatives:cop.layerClass(MyLayer,MyClass,{...})layerClass(MyLayer,MyClass,{...})MyLayer.layerClass(MyClass,{...})1316null48