cacaodev / cappuccino

Web application framework in JavaScript and Objective-J
http://cappuccino.org
GNU Lesser General Public License v2.1
37 stars 1 forks source link

Deferred addConstraint: #20

Open cacaodev opened 8 years ago

cacaodev commented 8 years ago

Currently, when a constraint is added to a detached view, the constraint is not added to the engine and the call silently fails.

This is due to the fact that the engine is hosted by the window and a detached view doesn't have any window.

The constraint should be added somewhere in the owner view and then added to the engine when the view acquires a window and an engine (-viewDidMoveToWindow).

cacaodev commented 8 years ago

Another way to do that would be to create a local engine for the orphan view and add constraints to it.

When the view gets a window,

This approach would also allow to layout the subtree of orphan views.