[Cuis-dev] Rerendering when touched: Experiments in simplifying UI development in Cuis inspired by Mithril.js
Hilaire Fernandes
hfern at free.fr
Sat May 6 06:42:12 PDT 2023
Hi Paul,
Coincidentally, a few weeks ago, I was reading about model-less GUI, not
any particular implementation like the ones you referred in your email,
but about the general idea to re-construct the whole or part of the GUI
when an event occurs.
It is true that it is not obvious to track the source of events with the
observer pattern: triggered in one place, hooked in another ones. The
tools to help the developer comprehension of events is not really there.
The fact that it is based on symbol and not object does not help. I
guess that what we all do is to search for symbol in the source code,
i.e. #selected.
Regarding the model, Morph itself is very neutral regarding the
necessity to have one. Pluggable morph requires one but many others
embed it (TextParagraphMorph, TextEnty Morph). And when required, there
are generic models (ValueHolder, ListModel, ...).
*A few points of thinking.*
It is possible to hook programmatically mouse/keyboard events to a
Morph. In your example the handlesMouseDown: and mouseButtons1xxx can be
set programmatically, so it avoid subclassing. It may help to compose
the GUI with sub morphs, using sub morphs improves the efficiency. In
your example the whole rectangle of the GUI is rebuild even if only a
small part needs to be updates.
I am wondering if the simplicity you get from just rebuilding GUI comes
with a hidden cost.
Concerning model, don't you need one at some point to represent the
state of your application ? So most the time the model is not a bargain
as it already exists. Ok may be not for your converter example.
In the Cuis-Smalltalk-UI, there is a UI-Mold package to describe field
input form, with data validation. It should be possible to add a kind of
computed ouput object.
Hilaire
--
GNU Dr. Geo
http://drgeo.eu
http://blog.drgeo.eu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230506/66a06d8c/attachment.htm>
More information about the Cuis-dev
mailing list