<div dir="ltr"><div>Hi,</div><div>Can you post a link to the code?</div><div><br></div><div>Cheers,</div><div>Karl<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 27, 2020 at 5:33 AM Ralph Boland <<a href="mailto:rpboland@gmail.com">rpboland@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I have a Morph subclass, say M, that contains a collection of<br>
"ItemMorph", say, as submorphs.<br>
When an M is displayed the ItemMorph submorphs are displayed in a<br>
column. An ItemMorph<br>
can act as a display of data but can also act as a button. This code<br>
all works as expected.<br>
<br>
I sometimes need an M morph to act similar to a MenuMorph; that is<br>
the M morph<br>
can be made to display on command, say from pressing some button. Then once the<br>
user presses on one of the M morph submorphs (ItemMorphs) the pressed upon<br>
submorph is to like a button invoking some action. Once the<br>
selection is made the<br>
entire M morph is to be deleted from the screen, like for a MenuMorph.<br>
<br>
Except in my case the button action never occurs and the M morph is not deleted.<br>
<br>
To get to the root of the problem I made copies of Classes MenuMorph<br>
and MenuItemMorph<br>
and was able to get menus to work using these classes. Once I got<br>
these copied morphs to<br>
work like regular menus I was able to set breakpoints without getting<br>
unwanted call stacks.<br>
<br>
I then made the changes to M and "ItemMorph" based upon what I<br>
learned about MenuMorph<br>
and MenuItemMorph. I then made a call stack occur when using the<br>
copied Morphs by having the<br>
method to invoke when a selection is made not exist. My classes M<br>
and ItemMorph have<br>
every method that is a mehod of MenuMorph or MenuItemMorph on the<br>
call stack. But none<br>
of them are called when I try to create a menu using M.<br>
<br>
It seems that some code that handles focus invokes a new process to<br>
handle the click by<br>
the mouse on a MenuItemMorph but doesn't do so or does so such that<br>
nothing happens<br>
when I click on a ItemMorph submorph of an M morph on my screen.<br>
<br>
Where can I set a breakpoint so that I can investigate why nothing<br>
happens when I click<br>
on a ItemMorph instance submorph of an M morph on the screen?<br>
<br>
Notes:<br>
1) When my M morph is first displayed there is at the top a balloon that says:<br>
<br>
Enter text to narrow selection<br>
down to matching items<br>
<br>
I didn't intend for this balloon to occur but it got picked up somehow.<br>
It would be useful to know how to change its text or remove it. I<br>
point it out here only because<br>
it may help explain what is happening.<br>
<br>
2) On mouseUp this balloon disappears.<br>
<br>
3) after the second mouseDown the M morph gains a shadow and can be<br>
picked up and moved.<br>
<br>
This is an open source project for teaching math/science to young kids.<br>
I have problems with the MIT license though so not sure what license I will use.<br>
<br>
Any help much appreciated and sorry about the post length.<br>
<br>
Ralph Boland<br>
<br>
</blockquote></div>