[General] Storing Values when a Morph is Persisted, How To

Philip Weaver philmaker at gmail.com
Wed Mar 4 08:18:48 CET 2009

I struggled with a very simple yet important subject and I just want to post
a possible solution here. I wanted to persist some simple values when one of
my morph instances was persisted. I am not using the Widgets class at this
time. My goal is persist some layout constraints on a morph.
The Morph class does extend from lively.data.Wrapper. lively.data.Wrapper
provides methods for setTrait and getTrait which do store and restore
automatically when a Morph is serialized and deserialized.

Another approach may be to use models. Because I'm not really yet using the
Widgets class I don't really have models working yet. There appears to be no
documentation yet for using models except for Examples.js.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090304/7fe1ac2c/attachment.html 

More information about the lively-kernel mailing list