繁体   English   中英

在Moose中,为什么不能用动作填充动态演示?

[英]In Moose, why can't I populate my dynamic presentation with an action?

这可以工作(出现调试器):

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时停止。 但是,第二个代码段(与第一个代码段不同,它使用动态表示)不会将操作转发到其文本表示。 那为什么呢? 我们如何将动作与动态演示相关联?

在动态演示中,动作似乎效果不佳。 在内部演示文稿中添加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'

暂无
暂无

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

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