سؤال

In Moose 4.6, here's my code:

finder := GLMFinder new.
finder show: [:a | 
    a dynamic display: (GLMTextPresentation new forSmalltalk);
    act: [self halt]
    on: $k 
      entitled: 'Implementors (k)' ].

finder openOn: 'Waaaaaaa'

If I click the little menu item, a debugger comes up. But, if I press apple-k, it doesn't. Why doesn't it?

هل كانت مفيدة؟

المحلول

It seems that actions do not work well in the dynamic presentation. But it works flawlessly if you add the action to the inner presentation (in this case to the GLMTextPresentation).

finder := GLMFinder new.
finder show: [:a | 
    a dynamic display: 
        (GLMTextPresentation new forSmalltalk;
        act: [self halt]
        on: $k 
        entitled: 'Implementors (k)')
    ].

finder openOn: 'Waaaaaaa'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top