[General] Morph Properties and Persistence

Philip Weaver philmaker at gmail.com
Tue Mar 3 23:51:33 CET 2009


Actually I realized that in this case I probably don't need models at all -
I probably just need to reinitialize the layout constraints when each
submorph is initialized from persistent state. I've only been using
initialize (and not initializePersistenState) and that's the problem. I'll
study examples and the code some more - duh.
Phil

On Tue, Mar 3, 2009 at 2:16 PM, Philip Weaver <philmaker at gmail.com> wrote:

> I'm done some more digging. It appears that I just need to use models. I
> found what I think are good examples
> in CheapListMorph.initialize/getSelection/setSelection) and I found
> ViewTrait in Core.js. I don't think I really need or want to use the Widget
> class atm but I see that many of the examples which use it. I'm just trying
> to store layout constraint info with a morph when it gets serialized. I'll
> post a code example if I don't get models working.
> Thank Robert.
>
> On Tue, Mar 3, 2009 at 11:56 AM, Robert Krahn <
> robert.krahn at student.hpi.uni-potsdam.de> wrote:
>
>> Hi Phil,
>>
>> can you give an example?
>>
>> Deserialization should work for common values (but not for all objects).
>> In
>> http://livelykernel.sunlabs.com/repository/lively-wiki/testworld3.xhtml I
>> assigned values to the red rectangle (testValue, testValue2).
>>
>> Robert
>>
>>
>>
>> On Mar 3, 2009, at 12:26 AM, Philip Weaver wrote:
>>
>>  I assigned a value to a custom property on a Morph. After I save the
>>> world to the wiki and load again, that property does not exist. The case
>>> here is that I wrote a new layout manager, have been attaching constraints
>>> to morphs, when I reload the constraints are gone, and subsequently child
>>> morphs do not resize when I resize the morph.
>>>
>>> How do I persist the custom properties of a Morph?
>>>
>>> Much appreciated,
>>> Phil
>>> _______________________________________________
>>> General mailing list
>>> General at livelykernel.sunlabs.com
>>> http://livelykernel.sunlabs.com/mailman/listinfo/general
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090303/071d5dbc/attachment.html 




More information about the lively-kernel mailing list