Pressing Esc on empty tree morph raises MNU

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Pressing Esc on empty tree morph raises MNU

Jakob Reschke
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:

Reply | Threaded
Open this post in threaded view
|

Re: Pressing Esc on empty tree morph raises MNU

marcel.taeumel
Hi Jakob,

does the change in Morphic-mt.1441 work for you?

Best,
Marcel

Am 21.04.2018 13:56:35 schrieb Jakob Reschke <[hidden email]>:

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:



Reply | Threaded
Open this post in threaded view
|

Re: Pressing Esc on empty tree morph raises MNU

Jakob Reschke
Hi Marcel,

I just did a quick positive test and yes, I can open the menu with Esc
as expected now. Though, I have not looked at your code changes and
did not check for new side-effects. ;-)

Kind regards,
Jakob

2018-05-24 14:50 GMT+02:00 Marcel Taeumel <[hidden email]>:

> Hi Jakob,
>
> does the change in Morphic-mt.1441 work for you?
>
> Best,
> Marcel
>
> Am 21.04.2018 13:56:35 schrieb Jakob Reschke <[hidden email]>:
>
> 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:
>
>
>
>