<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Christoph --<div><br></div><div>This idea might be similar to what tree widgets have: #getChildren, #hasChildren. At least this is what you example suggested via #output and #outputAvailable.</div><div><br></div><div>The implementor of a tree widget expects #hasChildren to be cheaper than #getChildren and can hence consider this when providing visual cues (i.e., the triangle/chevron to expand a tree item).</div><div><br></div><div>***</div><div><br></div><div>Considering "dynamic content" ... well ... it's a different beast. Well, TableLayout can deal with it, but our tools mostly use ProportionalLayout, which is not so dynamic when hiding or showing widgets.</div><div><br></div><div>Hmm... it seems like you want to combine #visible and #disableLayout into a new operation and call that #available. That wording seems too close to #enabled, which we use in buttons/sliders.</div><div><br></div><div>***</div><div><br></div><div>-1</div><div><br></div><div>Here is what I would do:</div><div>- Split up this idea into (a) a new operation on all morphs and (b) support via MorphicToolBuilder</div><div>- Mayble think of your "available" as an extended version of "visible" ... which I called "fully visible" in Widgets/Vivide (i.e. #hideFull, #showFull)</div><div>- Before exposing this via ToolBuilder, think about how to make the commonly used ProportionalLayout more dynamic (because you can always build tools in Morphic the old-fashioned way without using the ToolBuilder)</div><div><br></div><div>I think that it is worth pursuing this (rather bigger) topic because we also wanted to have an expandable file-save dialog for quite some time now. Maybe this could be a useful example for this idea.</div><div><br></div><div>Best,</div><div>Marcel</div><div><br></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 22.10.2021 20:18:24 schrieb christoph.thiede@student.hpi.uni-potsdam.de <christoph.thiede@student.hpi.uni-potsdam.de>:</p><div style="font-family:Arial,Helvetica,sans-serif">
Hi all,<br>
<br>
this changeset adds a new property to PluggableWidgetSpecs, #available. It can be used to show tool contents dynamically based on the result of a message send. Consider this toolbuilder method:<br>
<br>
    <span style="color: #800000">^</span><span style="color: #000000"> </span><span style="color: #000080">aBuilder</span><span style="color: #000000"> </span><span style="color: #000080">pluggablePanelSpec</span><span style="color: #000000"> </span><span style="color: #000080">new</span><span style="color: #000000"><br>
        </span><span style="color: #000080">layout:</span><span style="color: #000000"> </span><span style="color: #000080">#vertical</span><span style="color: #000000">;</span><span style="color: #000000"><br>
        </span><span style="color: #000080">children:</span><span style="color: #000000"> </span><span style="color: #000000">(</span><span style="color: #000000">OrderedCollection</span><span style="color: #000000"> </span><span style="color: #000080">new</span><span style="color: #000000"><br>
            </span><span style="color: #000080">add:</span><span style="color: #000000"> </span><span style="color: #008000">(</span><span style="color: #000080">aBuilder</span><span style="color: #000000"> </span><span style="color: #000080">pluggableTextSpec</span><span style="color: #000000"> </span><span style="color: #000080">new</span><span style="color: #000000"><br>
                </span><span style="color: #000080">model:</span><span style="color: #000000"> </span><span style="color: #800000">self</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">getText:</span><span style="color: #000000"> </span><span style="color: #000080">#input</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">setText:</span><span style="color: #000000"> </span><span style="color: #000080">#input:</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">yourself</span><span style="color: #008000">)</span><span style="color: #000000">;</span><span style="color: #000000"><br>
            </span><span style="color: #000080">add:</span><span style="color: #000000"> </span><span style="color: #008000">(</span><span style="color: #000080">aBuilder</span><span style="color: #000000"> </span><span style="color: #000080">pluggableTextSpec</span><span style="color: #000000"> </span><span style="color: #000080">new</span><span style="color: #000000"><br>
                </span><span style="color: #000080">model:</span><span style="color: #000000"> </span><span style="color: #800000">self</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">available:</span><span style="color: #000000"> </span><span style="color: #000080">#outputAvailable</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">getText:</span><span style="color: #000000"> </span><span style="color: #000080">#output</span><span style="color: #000000">;</span><span style="color: #000000"><br>
                </span><span style="color: #000080">yourself</span><span style="color: #008000">)</span><span style="color: #000000">;</span><span style="color: #000000"><br>
            </span><span style="color: #000080">yourself</span><span style="color: #000000">)</span><span style="color: #000000"><br>
        </span><span style="color: #000080">yourself</span><br>
<br>
Demo: ["available.gif"]<br>
Another helpful example could be dynamic displaying of a single button in a panel without needing to rebuild the entire panel (which is overhead and might remove relevant state).<br>
<br>
Changeset summary:<br>
- <b>PluggableWidgetSpec >> #available[:]</b> accessors<br>
- <b>getAvailableSelector</b> accessors and relevant <b>#update:</b> logic for almost all Morphic tool-buildable widget classes such as PluggableButtonMorphPlus, PluggableListMorphPlus, etc.<br>
- Patch in <b>MorphicToolBuilder</b> to set getAvailableSelector<br>
- <b>Morph >> #</b><b>makeAvailable::</b> Shows/hides and enables/disables the layout of a morph at the same time. I often use this together; see [<a href="https://forum.world.st/Morphic-equivalent-of-display-none-tp5114410p5114419.html">1</a>] for further information.<br>
- <b>DemoTool</b> that you can see above for quick demonstration. In any case I think a very simple example for the toolbuilding method would not harm in the MorphicExtras-Demos category.<br>
<br>
I request to review and merge or discuss this proposal. :-)<br>
<br>
<b>Note:</b> I do *not* ask to hide many buttons in our default Trunk tools, which would be a major UX change which for sure would have many disadvantages. But I see some advantages in providing this behavior for other tools which follow different UX guidelines.<br>
<br>
Best,<br>
Christoph<br>
<br>
[1] <a href="https://forum.world.st/Morphic-equivalent-of-display-none-tp5114410p5114419.html">https://forum.world.st/Morphic-equivalent-of-display-none-tp5114410p5114419.html</a><br>
<br>
<span style="color: #808080">---<br>
</span><i><span style="color: #808080">Sent from </span></i><i><u><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><span style="color: #808080">Squeak Inbox Talk</span></a></u></i>
</div></blockquote></div>