[squeak-dev] Merge Request: PluggableWidgetSpec >> #available
christoph.thiede at student.hpi.uni-potsdam.de
christoph.thiede at student.hpi.uni-potsdam.de
Fri Oct 22 18:02:48 UTC 2021
Hi all,
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:
^ aBuilder pluggablePanelSpec new
layout: #vertical;
children: (OrderedCollection new
add: (aBuilder pluggableTextSpec new
model: self;
getText: #input;
setText: #input:;
yourself);
add: (aBuilder pluggableTextSpec new
model: self;
available: #outputAvailable;
getText: #output;
yourself);
yourself)
yourself
Demo: ["available.gif"]
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).
Changeset summary:
- PluggableWidgetSpec >> #available[:] accessors
- getAvailableSelector accessors and relevant #update: logic for almost all Morphic tool-buildable widget classes such as PluggableButtonMorphPlus, PluggableListMorphPlus, etc.
- Patch in MorphicToolBuilder to set getAvailableSelector
- Morph >> #makeAvailable:: Shows/hides and enables/disables the layout of a morph at the same time. I often use this together; see [1] for further information.
- DemoTool 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.
I request to review and merge or discuss this proposal. :-)
Note: 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.
Best,
Christoph
[1] https://forum.world.st/Morphic-equivalent-of-display-none-tp5114410p5114419.html
---
Sent from Squeak Inbox Talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211022/e28d891f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: available.1.cs
Type: application/octet-stream
Size: 15201 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211022/e28d891f/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: available.gif
Type: image/gif
Size: 45106 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20211022/e28d891f/attachment-0001.gif>
More information about the Squeak-dev
mailing list
|