简体   繁体   English

在Spec中添加一行会导致列?

[英]Adding a row in Spec results in a column?

The current API of Spec is totally counter-intuitive. Spec的当前API完全违反直觉。 I am trying to stack up two rows in a SpecLayout. 我试图在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)? 并添加另一个TextModel将作为新列...如何添加实际行,因为每个人都理解它们:一个小部件低于或高于,而不是将它们添加到右侧或左侧(作为列)?

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. 因此,如果要垂直放置某些内容,则必须将其添加到列中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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