[squeak-dev] The Inbox: Morphic-cmfcmf.1496.mcz

Christian Flach cmfcmf.flach at gmail.com
Thu Aug 1 17:05:31 UTC 2019


Hi everyone,

I noticed that defining >>menu on a TextAttribute is currently not working,
because the TextEditor tries to call >>openAt: on the MenuMorph returned by
>>menu. I suppose >>openAt: is an old method that no longer exists?
I updated the code to use the >>popUpEvent:in:method instead. I have
attached a sample text attribute that shows the menu behaviour. Open it by
doit'ing "MyTextAttribute example". If you yellow click on "HERE" in the
opened textbox, the menu will appear.
I was not 100% sure what to set as the invoking view – "self model", "self
morph" or "self morph editView". Let me know what you think about my choice
of "self morph editView".

Best,
Christian

Am Do., 1. Aug. 2019 um 18:58 Uhr schrieb <commits at source.squeak.org>:

> A new version of Morphic was added to project The Inbox:
> http://source.squeak.org/inbox/Morphic-cmfcmf.1496.mcz
>
> ==================== Summary ====================
>
> Name: Morphic-cmfcmf.1496
> Author: cmfcmf
> Time: 1 August 2019, 6:57:12.047202 pm
> UUID: 34f7313a-f70a-3542-bd4d-9657b63cd95e
> Ancestors: Morphic-mt.1495
>
> Use MenuMorph>>popUpEvent:in: instead of not existing MenuMorph>>openAt:
> when yellow button clicking on a TextAttribute with >>menu defined.
>
> =============== Diff against Morphic-mt.1495 ===============
>
> Item was changed:
>   ----- Method: TextEditor>>yellowButtonDown: (in category 'events') -----
>   yellowButtonDown: event
>         "Process a yellow button event. Answer true if the event was
> handled, false otherwise."
>         (paragraph attributesAt: event cursorPoint) do:[:attr|
>                 attr menu ifNotNil:[
> +                       attr menu
> +                               setInvokingView: self morph editView;
> +                               popUpEvent: event in: self morph world.
> -                       attr menu openAt: event cursorPoint.
>                         ^true]].
>         ^false!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190801/153b69e8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MyTextAttribute.st
Type: application/octet-stream
Size: 834 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190801/153b69e8/attachment.obj>


More information about the Squeak-dev mailing list