[squeak-dev] Pressing Esc on empty tree morph raises MNU

Jakob Reschke forums.jakob at resfarm.de
Sat Apr 21 11:56:01 UTC 2018


Hi all,

I wanted to open the yellow button menu on an empty PluggableTreeMorph
(the SqueakMap catalog's package list to be precise, but I assume it
does not matter) and wanted to do so by pressing the escape key and
got the stack trace below.

The scroller of the PluggableTreeMorph is a TransformMorph, but it has
no submorphs if the tree is empty. Thus, in
numberOfItemsPotentiallyInView the localSubmorphBounds are nil, and
even if they were not, the next error would be a division by zero. The
TransformMorph does not expect to have no submorphs.

However, the real problem might be (or might not be) that a
PluggableTreeMorph behaves differently from a PluggableListMorph in
response to pressing Esc. The latter opens the yellow button menu,
while the tree morph does not treat Esc specially at all. It uses it
for list filtering instead, like any typed character. So effectively,
the Esc key in a tree morph is currently the "expand this node and
select the first child" key. I like the menu behavior from list morphs
better... What is your opinion?

Kind regards,
Jakob


UndefinedObject(Object)>>doesNotUnderstand: #height
TransformMorph>>numberOfItemsPotentiallyInView
PluggableTreeMorph(ScrollPane)>>numSelectionsInView
PluggableTreeMorph(SimpleHierarchicalListMorph)>>arrowKey:
PluggableTreeMorph(SimpleHierarchicalListMorph)>>specialKeyPressed:
PluggableTreeMorph>>specialKeyPressed:
PluggableTreeMorph(SimpleHierarchicalListMorph)>>keyStroke:
PluggableTreeMorph>>keyStroke:
PluggableTreeMorph(Morph)>>handleKeystroke:
KeyboardEvent>>sentTo:
PluggableTreeMorph(Morph)>>handleEvent:
PluggableTreeMorph(Morph)>>handleFocusEvent:
MorphicEventDispatcher>>doHandlingForFocusEvent:with:
MorphicEventDispatcher>>dispatchFocusEvent:with:
PluggableTreeMorph(Morph)>>processFocusEvent:using:
PluggableTreeMorph(Morph)>>processFocusEvent:
[] in [] in [] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
KeyboardEvent(MorphicEvent)>>becomeActiveDuring:
[] in [] in HandMorph>>sendFocusEvent:to:clear:


More information about the Squeak-dev mailing list