Sorry i posted only a partially uploaded file. Thi...
# two-minute-week
e
Sorry i posted only a partially uploaded file. This is a corrected version. Thanks to @wtaysom for catching that. Here is a short video showing how to build a temperature control. You proceed directly from a sketch to a final shippable product using Beads, with no prototyping necessary. A lot of wasted work happens in our industry by using wireframing tools that can't be executed. You are better off with a crude-looking working product than a fake but pretty demo. It saves time, when the final shapes are all worked out from the running product, then you apply the final polish. Beads is rare among languages in that it carries at runtime physical units of measurement (by creating a new datatype which carries the unit exponent array and magnitude of the value), and has pre-programmed all the common conversions, such as degrees Kelvin to degrees Centigrade, etc. In this example i also show how you can have two interlinked controls on the screen, and whichever one changes the model the other control tracks its value, all without any additional code.

https://youtu.be/JmmwmisRd2g

👍 3
m
great demo! one question, the track expression is tracking all events on all elements of the app or you specify which ones to track somehow? if all, how does it scale and how do you know which is the target?
e
When you are handed a big code base to learn, one of the hardest things to understand is which code is going to absorb a given event? When you have code that adds and subtracts listeners all over the place it can be very puzzling. So in Beads i made the design choice to force the author to put event tracking for each UI element right after the draw code. So each rectangular section of the screen has its draw chunk, and the tracking logic code must be put right afterwards. In the case of a mouse event, the runtime looks for the topmost overlapping rectangle, and gives the topmost handler the chance to look at the event and process it. If the tracking code returns Y the event is absorbed and disappears, but if the tracking code doesn't absorb the next chunk that handles that event gets a chance to absorb. All incoming events whether they be keystrokes, network events, synthetic events, or finger taps, are fed through a serialized event model i call the Loom. The overall goal is to allow post mortem debugging with visualization of the screen as time is run backwards.
👍 1
👍🏽 2
i
Is it possible to set up the layout declarations so that the sizes of elements (eg: the
100
in
add 100 al d_dual
) can be adjusted with some runtime logic? What would the code for that look like?
Also, how do you handle the case where you want a symbol to respond to drag-over or drag-out? Can you add those to track, with something like
| EV_DRAG_OUT
?