2

これは機能します(デバッガーが起動します):

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 が押されると停止します。ただし、2 番目のスニペット (最初のスニペットとは異なり、動的なプレゼンテーションを使用します) は、アクションをテキスト プレゼンテーションに転送しません。それで、それはなぜですか?アクションを動的なプレゼンテーションに関連付けるにはどうすればよいでしょうか?

4

1 に答える 1

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'
于 2011-11-17T22:11:50.207 に答える