[squeak-dev] Morphic equivalent of 'display: none'?

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Fri Apr 3 14:39:55 UTC 2020


Hi all,


does Morphic has an equivalent of JavaScript's 'display: none'?

#show/#hide/#visible: reserve space for the hidden morph. However, there are other scenarios where you do not want to reserve space. (A simple example would be a list that should only appear iff it has items.)

In JS, you can use 'display: none' instead of 'visibility: hidden' to give the space back to the element's remaining siblings.

But in Morphic, is there currently any better option than #delete (and #addMorph:) later?


(IMO, delete'n'add is not always the best pattern to do this. You need to remember the index and owner of the relevant morph for adding it later.)


Provided that I did not overlook any existing features, would you consider this a useful extension for Morphic?

I was thinking of a property (#skipLayout, if you do not have any better idea) and a convenience method (#nonSkippedSubmorphs) that rejects suppressed submorphs. TableLayout would need to use this selector instead of regular #submorphs.

Or would this break too many existing things that rely on #submorphs?


Another approach would be a selector in the TableLayoutProperties to have all submorphs skipped that are hidden via classical #visible. But this would be less powerful as you couldn't combine both kinds of hiding in the same morph. But maybe this would be even better in terms of avoiding complexity?


I'm looking forward to your opinions.


Best,

Christoph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200403/25e1973f/attachment.html>


More information about the Squeak-dev mailing list