>
>
> Another remark, why is
> height: self inputTextHeight;
> needed?
>
> Should not spec have a default automatic way to set it, deducing from
> the row contents?
Actually it would do the opposite. The content has no fixed height so if
you don't specify the height it will actually expand the content (the
layout always uses all available space if not constrained).
You can see for yourself if you remove the height here...
=================================
view := DynamicComposableModel new
instantiateModels: #(
usernameLabel LabelModel usernameField TextInputFieldModel
passwordLabel LabelModel passwordField TextInputFieldModel
showPasswordCheckBox CheckBoxModel
);
yourself.
view usernameLabel text: 'Username'.
view passwordLabel text: 'Password'.
view showPasswordCheckBox label: 'Show password'.
layout := SpecLayout composed
newColumn: [ :col |
col
newRow: [ :row |
row
add: #usernameLabel;
add: #usernameField ] height: DynamicComposableModel inputTextHeight;
newRow: [ :row |
row
add: #passwordLabel;
add: #passwordField ] height: DynamicComposableModel inputTextHeight;
newRow: [ :row |
row
add: #showPasswordCheckBox] height: DynamicComposableModel inputTextHeight;
newRow: [ :row | ]
];
yourself.
view openWithSpecLayout: layout.
=====================================
Peter