<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>> <span style="font-size:12pt">You could have such a "removed morph" temporarily #become: a collapsed </span><span style="font-size:12pt">representation (like a flat invisible morph for a list item), and then </span><span style="font-size:12pt">swap it back
 when you need it. I have used that pattern; #become: is fast.</span></p>
<div><br>
</div>
<div>Hm, this does not convince me. :-) #become: replaces all references to the original morph. I could not access or modify any part of it during it is collapsed, or I would need to deal with a second variable. This feels like unnecessary metaprogramming.</div>
<div><br>
</div>
<div>> <span style="font-size:12pt">Oh, yes, please do not add any logic to #submorphs. It is a plain array </span><span style="font-size:12pt">and a lot of things rely on this. You can implement a wrapper Morph with </span><span style="font-size:12pt">all
 that logic, instead.</span>
<div><br>
</div>
<div>I may have expressed myself wrong - I would never override #submorphs, I meant to introduce a second selector, #nonSkippedSubmorphs.</div>
<div><br>
</div>
<div>So your general advice is to introduce a special morph that supports morph skipping? The disadvantages of this approach would the limitation that you cannot skip morphs in any regular morphs such as MorphicModels, RectangleMorphs etc. ... I would rather
 like to use a layout for this.</div>
<div><br>
</div>
<div>Best,</div>
<div>Christoph</div>
</div>
<p></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Stéphane Rollandin <lecteur@zogotounga.net><br>
<b>Gesendet:</b> Freitag, 3. April 2020 17:48:16<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] Morphic equivalent of 'display: none'?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">> #show/#hide/#visible: reserve space for the hidden morph. However, there
<br>
> are other scenarios where you do not want to reserve space. (A simple <br>
> example would be a list that should only appear iff it has items.)<br>
<br>
You could have such a "removed morph" temporarily #become: a collapsed <br>
representation (like a flat invisible morph for a list item), and then <br>
swap it back when you need it. I have used that pattern; #become: is fast.<br>
<br>
> <br>
> In JS, you can use 'display: none' instead of 'visibility: hidden' to <br>
> give the space back to the element's remaining siblings.<br>
> <br>
> But in Morphic, is there currently any better option than #delete (and <br>
> #addMorph:) later?<br>
> <br>
> <br>
> (IMO, delete'n'add is not always the best pattern to do this. You <br>
> need to remember the index and owner of the relevant morph for adding it <br>
> later.)<br>
> <br>
> <br>
> Provided that I did not overlook any existing features, would you <br>
> consider this a useful extension for Morphic?<br>
<br>
No. I think this should be implemented either via specific mophs or via <br>
specific layout (probably yet to be invented).<br>
<br>
> <br>
> I was thinking of a property (#skipLayout, if you do not have any better <br>
> idea) and a convenience method (#nonSkippedSubmorphs) that <br>
> rejects suppressed submorphs. TableLayout would need to use this <br>
> selector instead of regular #submorphs.<br>
> <br>
> Or would this break too many existing things that rely on #submorphs?<br>
<br>
Oh, yes, please do not add any logic to #submorphs. It is a plain array <br>
and a lot of things rely on this. You can implement a wrapper Morph with <br>
all that logic, instead.<br>
<br>
> <br>
> <br>
> Another approach would be a selector in the TableLayoutProperties <br>
> to have all submorphs skipped that are hidden via classical #visible. <br>
> But this would be less powerful as you couldn't combine both kinds of <br>
> hiding in the same morph. But maybe this would be even better in terms <br>
> of avoiding complexity?<br>
<br>
Not a good idea IMO to use a property tag to represent another property. <br>
#visible should just be about visibility.<br>
<br>
Best,<br>
<br>
Stef<br>
<br>
</div>
</span></font>
</body>
</html>