首页 > 解决方案 > 以编程方式更改 GLMStacker 选项卡(Glamour、Smalltalk)

问题描述

我正在尝试以编程方式打开一个或两个选项卡,类似于这个工作示例......

browser := GLMTabulator new.
    browser column: #blah.
    (browser transmit)
        to: #blah;
        andShow: [ :a |
        a list title: 'One'.
        a text title: 'Two'.
        tab := a.].
 browser openOn: Object.

browser panes last lastActivePresentation: browser panes last presentations last.

...但使用堆垛机,如下所示:

browser := GLMTabulator new.
browser title: 'Prueba'.
browser column: #testColumn.
browser transmit
    to: #testColumn;
    andShow: [ :presentation | 
        | first second |
        first := #'first'.
        second :=  #'second'.
        innerStacker := GLMStacker new.
        presentation custom: innerStacker.
        innerStacker panes: { first . second }.
        innerStacker transmit
            to: first;
            andShow: [ :p | p title: first ].
        innerStacker transmit
            to: second;
            andShow: [ :p | p title: second ].
        "innerStacker selection: Dictionary.
        innerStacker selection: second." ].
browser openOn: #('first...' 'second...').

我尝试了不同的方法,但似乎没有任何效果。喜欢:

browser panes last lastActivePresentation: innerStacker panes last presentations pane.

或者

innerStacker panes last lastActivePresentation: innerStacker panes last presentations pane.

任何想法?

标签: smalltalk

解决方案


推荐阅读