Closed Ducasse closed 2 months ago
In fact, this is more general: when you update a layout that is already visible, it is preferable to do the update in one step. It will only recompute the layout one time. It is doable when you have nested layouts: you create layouts (not visible, e.g. SpBoxLayout newTopToBottom ad: …) starting from leafs, and then go up until all layouts are ready. Then you set the top layout to the currently visible layout, e.g. visiblePresenter layout: myNewlyCreatedLayout
It is something to mention in the book.
I never saw the problem, because I always build layouts bottom-up 😄.
TODO: add "Pay attention" to chapter on Dynamic Presenters.
Hi koen
Guille told me the following and I try to understand it :) @guillep
To optimize the speed once the settings browser is open we should build the layout before setting it to avoid too many rebuild: This boils down to building the children and then adding them to your dynamic layout.
In the case you build a tree of presenters, build the tree bottoms-up, first the leaves, then bubbling up in the tree.