<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>I think you may have spotted a bug. From what I observe,
      LayoutMorph does not layout its children properly after a submorph
      is added at front position (the added submorph is layed out as if
      it were the last submorph).<br>
    </p>
    <div class="moz-cite-prefix">El 10/8/24 a las 08:40, Mark Volkmann
      via Cuis-dev escribió:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFfRWnXU74yYhk9cobkaWoOKDRNa+_VPR5SKTMSOV-3=B6ATaw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div dir="ltr">On Fri, Aug 9, 2024 at 7:54 PM Mark Volkmann <<a
            href="mailto:r.mark.volkmann@gmail.com"
            moz-do-not-send="true" class="moz-txt-link-freetext">r.mark.volkmann@gmail.com</a>>
          wrote:<br>
        </div>
        <div class="gmail_quote">
          <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">I want to add a morph as the first
              submorph in a <font face="monospace">LayoutMorph</font>
              that already has submorphs.
              <div>I thought the <font face="monospace">addMorphFront:</font>
                method would do that, but it doesn't.</div>
              <div>This code seems surprising:</div>
              <div><br>
              </div>
              <div><font face="monospace">lm := LayoutMorph newColumn
                  openInWorld.<br>
                  lm addMorph: (LabelMorph new contents: 'one').<br>
                  lm addMorph: (LabelMorph new contents: 'two').<br>
                  first := lm submorphs first.</font><br clear="all">
                <div><br>
                </div>
                <div><font face="monospace">first</font> will be set to
                  the <font face="monospace">LabelMorph</font> whose
                  content is 'two', not 'one'.</div>
                <div><br>
                </div>
                <div>Is there a way to add a morph to the beginning of a
                  <font face="monospace">LayoutMorph</font>?</div>
              </div>
            </div>
          </blockquote>
        </div>
        <div><br>
        </div>
        <div>I see now that sending <font face="monospace">#addMorphFront:</font>
          does add a morph to the beginning of the <font
            face="monospace">submorphs</font> array, but the parent
          morph does not automatically redraw itself. Sending <font
            face="monospace">#redrawNeeded</font> to the parent does not
          force it to redraw using the updated submorphs array. What can
          I do to force that?</div>
        <div><br>
        </div>
        <span class="gmail_signature_prefix">-- </span><br>
        <div dir="ltr" class="gmail_signature">
          <div dir="ltr">
            <div>
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div dir="ltr">
                      <div><font face="arial, helvetica, sans-serif">R.
                          Mark Volkmann</font></div>
                      <div><span style="font-size:12.8px"><font
                            face="arial, helvetica, sans-serif">Object
                            Computing, Inc.</font></span></div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
    </blockquote>
  </body>
</html>