Question

This works (a debugger comes up):

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

But this doesn't (no debugger comes up):

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'

Both are supposed to do the same thing: halt when apple-k is pressed in a text view. However, the second snippet (which uses a dynamic presentation, unlike the first) does not forward the action to its text presentation. So, why's that? How can we associate an action with our dynamic presentation?

No correct solution

OTHER TIPS

It seems that actions do not work well in the dynamic presentation. Adding the selectionPopulate:on:entitled:with: to the inner presentation will work.

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'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top