Reputation: 108
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?
Upvotes: 2
Views: 87
Reputation: 108
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'
Upvotes: 1