Hi Piotr,
like you already found out, you can use whenBuiltDo:
But instead of using #hResizing: , which is not explicit in specs api
you can call the method hShrinkWrap (look in AbstractMorphicAdapter,
protocol 'protocol').
Here is a small example with centering a label:
| ui layout |
ui := DynamicComposableModel new.
ui title: 'hello'.
ui instantiateModels: #(
label LabelModel
check CheckBoxModel
text TextInputFieldModel
button ButtonModel ).
ui label text:'Hello World'.
ui label whenBuiltDo:[: widget |widget widget hShrinkWrap.].
layout := SpecLayout composed
newRow: [ :r | r add: #label] height: 25;
yourself.
ui openWithSpecLayout: layout.
the block arguemt for whenBuiltDo: is a WidgetBuilt announcement, that
gives you access to the model and the widget (-adapter)
that is used.
nicolai