【问题标题】:How to close a window with Spec in Pharo如何在 Pharo 中使用 Spec 关闭窗口
【发布时间】:2014-06-03 04:48:22
【问题描述】:

我有一个带有多个控件的 Spec 窗口。当我单击“确定”按钮时,我希望关闭窗口。

| m |
m := DynamicComposableModel new.
m instantiateModels: #(text TextModel ok OkToolbar).
m ok okAction: [ self close ].
m openWithSpecLayout: (SpecLayout composed
    newColumn: [ : c | c add: #text ; add: #ok height: 30 ];
    yourself).

我已尝试发送删除和关闭,但没有成功。如何关闭窗口?

【问题讨论】:

    标签: user-interface smalltalk pharo spec-ui


    【解决方案1】:

    你可以这样做:

    | m |
    m := DynamicComposableModel new.
    m instantiateModels: #(text TextModel ok OkToolbar).
    m ok okAction: [ m window close ].
    m openWithSpecLayout: (SpecLayout composed
        newColumn: [ : c | c add: #text ; add: #ok height: 30 ];
        yourself).
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-08
      • 1970-01-01
      相关资源
      最近更新 更多