[General] Morph Properties and Persistence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[General] Morph Properties and Persistence

Philip Weaver
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090303/c8a51565/attachment.html 


Reply | Threaded
Open this post in threaded view
|

[General] Morph Properties and Persistence

Robert Krahn
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,@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
> [hidden email]
> http://livelykernel.sunlabs.com/mailman/listinfo/general



Reply | Threaded
Open this post in threaded view
|

[General] Morph Properties and Persistence

Philip Weaver
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@11:56 AM, Robert Krahn <
[hidden email]> 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,@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
>> [hidden email]
>> http://livelykernel.sunlabs.com/mailman/listinfo/general
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://livelykernel.sunlabs.com/pipermail/general/attachments/20090303/9f5e0b0d/attachment.html 


Reply | Threaded
Open this post in threaded view
|

[General] Morph Properties and Persistence

Philip Weaver
Actually I realized that in this case I probably don't need models@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@2:16 PM, Philip Weaver <[hidden email]> 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@11:56 AM, Robert Krahn <
> [hidden email]> 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,@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
>>> [hidden email]
>>> 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