【问题标题】:In Moose, why can't I populate my dynamic presentation with an action?在 Moose 中,为什么我不能用动作填充动态演示文稿?
【发布时间】:2011-11-15 13:59:16
【问题描述】:

这可行(调试器出现):

bubbler := GLMFinder new.
bubbler show: [:a | 
    a text
    selectionPopulate: #selection 
    on: $k 
        entitled: 'Implementors (k)' 
    with: [ :text | text inspect. self halt]].
bubbler openOn: 'Waaaaaaa'

但这没有(没有调试器出现):

bubbler := GLMFinder new.
bubbler show: [:a | 
    a dynamic display: (GLMTextPresentation new forSmalltalk);
    selectionPopulate: #selection 
    on: $k 
        entitled: 'Implementors (k)' 
    with: [ :text | text inspect. self halt]].
bubbler openOn: 'Waaaaaaa'

两者都应该做同样的事情:在文本视图中按下 apple-k 时停止。但是,第二个 sn-p(与第一个不同,它使用动态表示)不会将操作转发到其文本表示。那么,这是为什么呢?我们如何将动作与动态演示相关联?

【问题讨论】:

    标签: smalltalk pharo moose-technology


    【解决方案1】:

    似乎动作在动态演示中效果不佳。将 selectionPopulate:on:entitled:with: 添加到内部演示文稿中即可。

    bubbler := GLMFinder new.
    bubbler show: [:a | 
        a dynamic display: 
            (GLMTextPresentation new forSmalltalk;
            selectionPopulate: #selection 
            on: $k 
            entitled: 'Implementors (k)' 
            with: [ :text | text inspect. self halt])
        ].
    bubbler openOn: 'Waaaaaaa'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      • 2014-08-01
      • 1970-01-01
      • 2014-08-26
      • 2014-08-19
      相关资源
      最近更新 更多