简体   繁体   中英

Adding a row in Spec results in a column?

The current API of Spec is totally counter-intuitive. I am trying to stack up two rows in a SpecLayout. How is that adding a row ends up with two columns?

| m |
m := DynamicComposableModel new.
m instantiateModels: #(text1 TextModel ok OkToolbar).
m ok okAction: [ m window delete ].
m openWithSpecLayout: (SpecLayout composed
    newRow: [: r | r add: #text1 ; add: #ok ];
    yourself).

SpecLayout有两列

and adding another TextModel will be placed as a new column... How to add real rows, as everybody understands them: one widget below or above, instead of adding them to the right or left (as columns)?

Because you add a row, and add items to row. And items of row are positioned horizontally. So if you want to position something vertically, you have to add it to column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM