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>
    <font color="#800000">^</font><font color="#000000"> </font><font color="#000080">aBuilder</font><font color="#000000"> </font><font color="#000080">pluggablePanelSpec</font><font color="#000000"> </font><font color="#000080">new</font><font color="#000000"><br>
        </font><font color="#000080">layout:</font><font color="#000000"> </font><font color="#000080">#vertical</font><font color="#000000">;</font><font color="#000000"><br>
        </font><font color="#000080">children:</font><font color="#000000"> </font><font color="#000000">(</font><font color="#000000">OrderedCollection</font><font color="#000000"> </font><font color="#000080">new</font><font color="#000000"><br>
            </font><font color="#000080">add:</font><font color="#000000"> </font><font color="#008000">(</font><font color="#000080">aBuilder</font><font color="#000000"> </font><font color="#000080">pluggableTextSpec</font><font color="#000000"> </font><font color="#000080">new</font><font color="#000000"><br>
                </font><font color="#000080">model:</font><font color="#000000"> </font><font color="#800000">self</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">getText:</font><font color="#000000"> </font><font color="#000080">#input</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">setText:</font><font color="#000000"> </font><font color="#000080">#input:</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">yourself</font><font color="#008000">)</font><font color="#000000">;</font><font color="#000000"><br>
            </font><font color="#000080">add:</font><font color="#000000"> </font><font color="#008000">(</font><font color="#000080">aBuilder</font><font color="#000000"> </font><font color="#000080">pluggableTextSpec</font><font color="#000000"> </font><font color="#000080">new</font><font color="#000000"><br>
                </font><font color="#000080">model:</font><font color="#000000"> </font><font color="#800000">self</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">available:</font><font color="#000000"> </font><font color="#000080">#outputAvailable</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">getText:</font><font color="#000000"> </font><font color="#000080">#output</font><font color="#000000">;</font><font color="#000000"><br>
                </font><font color="#000080">yourself</font><font color="#008000">)</font><font color="#000000">;</font><font color="#000000"><br>
            </font><font color="#000080">yourself</font><font color="#000000">)</font><font color="#000000"><br>
        </font><font color="#000080">yourself</font><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>
<font color="#808080">---<br>
</font><i><font color="#808080">Sent from </font></i><i><u><a href="https://github.com/hpi-swa-lab/squeak-inbox-talk"><font color="#808080">Squeak Inbox Talk</font></a></u></i>