<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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>I did not change the behavior of #<span>beReplacementFor:. However, I wonder why it is forbidden to replace a morph from a different world.</span></p>
<p><span>Do you actually want this?</span></p>
<div id="x_Signature">
<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>
<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 commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Freitag, 20. September 2019 20:25:38<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Morphic-ct.1527.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">A new version of Morphic was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Morphic-ct.1527.mcz">http://source.squeak.org/inbox/Morphic-ct.1527.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Morphic-ct.1527<br>
Author: ct<br>
Time: 20 September 2019, 8:25:26.969726 pm<br>
UUID: 92cf521a-6df8-784b-b6c7-7be9cdcf8493<br>
Ancestors: Morphic-mt.1526<br>
<br>
Allow for constructing CollapsedMorphs for different owners<br>
<br>
Primarily, it was not possible to create a CollapsedMorph for a Morph not-yet-in-world before. Now you can do:<br>
<br>
(CollapsedMorph createReplacementFor: Morph new in: World) centerWithWrappees: 100 @ 100<br>
<br>
=============== Diff against Morphic-mt.1526 ===============<br>
<br>
Item was added:<br>
+ ----- Method: CollapsedMorph class>>createReplacementFor:in: (in category 'instance creation') -----<br>
+ createReplacementFor: aMorph in: anOwner<br>
+ <br>
+        ^ self new<br>
+                beReplacementFor: aMorph in: anOwner;<br>
+                yourself!<br>
<br>
Item was changed:<br>
  ----- Method: CollapsedMorph>>beReplacementFor: (in category 'collapse/expand') -----<br>
  beReplacementFor: aMorph<br>
+        "Encapsulate aMorph with the CollapsedMorph and display the latter"<br>
  <br>
+        | itsWorld |<br>
-        | itsWorld priorPosition |<br>
         (itsWorld := aMorph world) ifNil: [^self].<br>
+        self beReplacementFor: aMorph in: itsWorld.!<br>
-        uncollapsedMorph := aMorph.<br>
-                        <br>
-        self setLabel: aMorph externalName.<br>
-        aMorph delete.<br>
-        itsWorld addMorphFront: self.<br>
-        self collapseOrExpand.<br>
-        (priorPosition := aMorph valueOfProperty: #collapsedPosition ifAbsent: [nil])<br>
-        ifNotNil:<br>
-                [self position: priorPosition].<br>
- !<br>
<br>
Item was added:<br>
+ ----- Method: CollapsedMorph>>beReplacementFor:in: (in category 'collapse/expand') -----<br>
+ beReplacementFor: aMorph in: anOwner<br>
+        "Encapsulate aMorph with the CollapsedMorph and display the latter in anOwner"<br>
+ <br>
+        | priorPosition |<br>
+        uncollapsedMorph := aMorph.<br>
+        <br>
+        self setLabel: aMorph externalName.<br>
+        aMorph delete.<br>
+        self privateOwner: anOwner. "lest RealEstateAgent fail at positioning me"<br>
+        self collapseOrExpand.<br>
+        anOwner addMorphFront: self.<br>
+        (priorPosition := aMorph valueOfProperty: #collapsedPosition ifAbsent: [nil])<br>
+                ifNotNil: [self position: priorPosition].!<br>
<br>
Item was added:<br>
+ ----- Method: CollapsedMorph>>centerWithWrappees: (in category 'adjusting') -----<br>
+ centerWithWrappees: aPoint<br>
+ <br>
+        self center: aPoint.<br>
+        uncollapsedMorph center: aPoint.!<br>
<br>
Item was added:<br>
+ ----- Method: CollapsedMorph>>uncollapsedMorph (in category 'accessing') -----<br>
+ uncollapsedMorph<br>
+ <br>
+        ^ uncollapsedMorph!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>