[Cuis] mouseButton2Up:localPosition:

Juan Vuletich juan at jvuletich.org
Mon Apr 27 06:10:53 CDT 2015


Hi Dan,

So, where's the bug? It's in your #mouseButton2Up:localPosition: . You get
a point in local coordinates (you can check this bu just adding
'localEventPosition print'). And you ask for the menu to open there. But
the menu is not a submorph. It will be a submorph of the world. (this is
again easy to check by opening an inspector on the menu, by doing 'self
inspect').

What you want is, instead of just using 'localEventPosition' to use '(self
externalizeToWorld: localEventPosition)'. Your alternative
#xmouseButton2Activity is perfectly fine too.

Cheers,
Juan vuletich

On Fri, April 24, 2015 12:15 pm, Dan Norton wrote:
> On 24 Apr 2015 at 7:58, Juan Vuletich wrote:
> [snip]
>
>>
>> I can't understand what you are specifically referring to when you
>> say "The above method was employed to show a pop-up menu which appeared
>> relative to World (incorrect). If
>> #mouseButton2Activity is used instead of the above method, it will
>> appear in the right place - relative to the morph where the click was
>> done, instead of relative to World."
>>
> Sorry for the the fog. The attached zip contains two change sets which
> should show the problem:
>
>
> Load both change sets and do: BouncingAtomsMorph new.
> Move the window away from the upper left of the display, if necessary.
> Right click over the window. Pop-up appears /away/ from where the click is
> done.
>
> The method #xmouseButton2Activity shows code that works, provided it is
> renamed #mouseButton2Activity and #mouseButton2Up:localPosition: is
> deleted.
>
> I hope this helps :)
>
>
> - Dan
> The following section of this message contains a file attachment
> prepared for transmission using the Internet MIME message format. If you
> are using Pegasus Mail, or any other MIME-compliant system, you should be
> able to save it or view it from within your mailer. If you cannot, please
> ask your system administrator for assistance.
>
> ---- File information -----------
> File:  Button2UpLocation.zip
> Date:  24 Apr 2015, 10:50
> Size:  5229 bytes.
> Type:  ZIP-archive
> _______________________________________________
> Cuis mailing list
> Cuis at jvuletich.org
> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>
>





More information about the Cuis mailing list