Indeed using a single top level container should be the best approach, because "SpecLayout composed" doesn't have any layout - so adding multiple items into it are just placed one over the other. Arguably it might be better to add new methods "SpecLayout rows/SpecLayout cols" or something like that so you have the base layout defined. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ view := DynamicComposableModel new. models := #( leftCol LabelModel t11 LabelModel t12 LabelModel t13 LabelModel t21 LabelModel t22 LabelModel t23 LabelModel ). view instantiateModels: models. models pairsDo: [ :lbl :m | (view perform: lbl asSymbol) label: lbl. ]. layout := SpecLayout composed newRow: [ :r | r newColumn: [ :col | col add: #leftCol ]. r newColumn: [ :col | col newRow: [ :row | row add: #t11; add: #t12; add: #t13 ]; newRow: [ :row | row add: #t21; add: #t22; add: #t23 ] ] ]; yourself. view openWithSpecLayout: layout. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter On Tue, May 19, 2015 at 3:04 PM, Nicolai Hess <nicolaihess@web.de> wrote:
2015-05-19 14:34 GMT+02:00 Craig Johnson <craig@hivemind.net>:
Hi,
Spec has me tearing my hair out again.
I'm using a composed layout with two columns in it. In the second column I'd like to place some rows which in turn contain columns.
There does not seem to be any way to do this. Everthing that I try only renders one of the two main columns. Guidance would be spreciated.
I don't know for sure, but I had a similar issue and solved it by using a single toplevel container (only one call newRow/newColumn after "SpecLayout composed")
^ SpecLayout composed newRow:[ :top |
top newColumn: [ :tcol | tcol newRow:[:trow | trow add: #lblFolder ] height: 30. ];
newColumn: [ :tcol | tcol newRow:[:trow | trow newColumn: [ :tcol2 | tcol2 add: #ddlfolder]; newColumn: [ :tcol2 | tcol2 add: #txtFolder]. ] height: 30. ]. ]
defaultSpec <spec: #default>
^SpecLayout composed newColumn: [ :tcol | tcol newRow:[:trow | trow add: #lblFolder ] height: 30. ];
newColumn: [ :tcol | tcol newRow:[:trow | trow newColumn: [ :tcol2 | tcol2 add: #ddlfolder]; newColumn: [ :tcol2 | tcol2 add: #txtFolder]. ] height: 30. ].