Roassal2: how to add a node to a layout post-factum?

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

Roassal2: how to add a node to a layout post-factum?

jfabry
Hola,

Say I have a layout:

elements := <a collection of elements>
layout := RTForceBasedLayout new applyOn: elements; yourself

and then later I instantiate another element newElement, how can I tell the layout to take this one into account as well? If I add it to the collection of elements, nothing happens, and if I  add it to the collection of elements contained in the layout I get the red error morph. :-(

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal2: how to add a node to a layout post-factum?

Tudor Girba-2
You probably have to reapply the layout on the new collection.

It would be cool to get an animation that can handle such an addition.

Doru


On Sun, Jun 8, 2014 at 11:28 PM, Johan Fabry <[hidden email]> wrote:
Hola,

Say I have a layout:

elements := <a collection of elements>
layout := RTForceBasedLayout new applyOn: elements; yourself

and then later I instantiate another element newElement, how can I tell the layout to take this one into account as well? If I add it to the collection of elements, nothing happens, and if I  add it to the collection of elements contained in the layout I get the red error morph. :-(

---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal2: how to add a node to a layout post-factum?

abergel
In reply to this post by jfabry
Simply do “layout on: <your collection of elements>”

Alexandre

On Jun 8, 2014, at 5:28 PM, Johan Fabry <[hidden email]> wrote:

> Hola,
>
> Say I have a layout:
>
> elements := <a collection of elements>
> layout := RTForceBasedLayout new applyOn: elements; yourself
>
> and then later I instantiate another element newElement, how can I tell the layout to take this one into account as well? If I add it to the collection of elements, nothing happens, and if I  add it to the collection of elements contained in the layout I get the red error morph. :-(
>
> ---> Save our in-boxes! http://emailcharter.org <---
>
> Johan Fabry   -   http://pleiad.cl/~jfabry
> PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal2: how to add a node to a layout post-factum?

jfabry

Yes, that works, thanks! But …
- there is no force being applied in the layout on any elements at all
- as Doru said, there is no animation when it is added even though I have a RTSpringLayoutStepping animation on the view :-(

On Jun 8, 2014, at 5:36 PM, Alexandre Bergel <[hidden email]> wrote:

> Simply do “layout on: <your collection of elements>”
>
> Alexandre
>
> On Jun 8, 2014, at 5:28 PM, Johan Fabry <[hidden email]> wrote:
>
>> Hola,
>>
>> Say I have a layout:
>>
>> elements := <a collection of elements>
>> layout := RTForceBasedLayout new applyOn: elements; yourself
>>
>> and then later I instantiate another element newElement, how can I tell the layout to take this one into account as well? If I add it to the collection of elements, nothing happens, and if I  add it to the collection of elements contained in the layout I get the red error morph. :-(
>>
>> ---> Save our in-boxes! http://emailcharter.org <---
>>
>> Johan Fabry   -   http://pleiad.cl/~jfabry
>> PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>



---> Save our in-boxes! http://emailcharter.org <---

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD lab  -  Computer Science Department (DCC)  -  University of Chile


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev