[haXe] arctic
Asger Ottar Alstrup
asger at area9.dk
Fri Nov 3 14:37:56 CET 2006
On 11/3/06, Michael Pliskin <pl at tepkom.ru> wrote:
>
> Another idea is to introduce a concept of block manager, and provide
> a callback to retrieve it:
> Border(x : Float, y : Float, setManager: BorderManager -> Void)
> and then initialize it like
> ArcticBlock.Border(x, y, function (mgr) { myMgr = mgr; });
>
> so you can remember the managers for the objects you need, and do
> partial updates using them later.
Yes, I considered this approach as well. However, this will quickly lead to
a classical Object Oriented design where each widget comes with it's own
class.
In effect, each ArcticBlock enum entry would be mirrored by a corresponding
class, as an alternative interface to the block. These classes would have
the same properties as the enum members, but just in a different disguise.
I'd like to avoid that in Arctic, because I think the enum-approach is
simpler to work with.
When there is no ScrollBar class, this means that there is no way to update
an existing scrollbar block in a view. Once a block is displayed, it is
protected from the outside - it can tell you what happens, but you can not
get to that (easily).
Instead, what you should do is *replace* the existing scrollbar with a new
one. So if you want to update a scrollbar with a new position, the way to do
it is to construct a new scrollbar enum that looks like you want it, and
then replace the old scrollbar block with the new one:
view.update("myScrollbar", Scrollbar(the new scrollbar));
This way, there is no considerations about lifetime or sharing of objects.
You do not have to learn the interface of each different class. Instead,
look at the ArcticBlock enum, and there you can see everything that Arctic
can do at the lowest level.
(Disclaimer: There is no partial update mechanism in Arctic yet. You have to
update the entire screen right now to change something on the screen from
the outside of arctic.)
Regards,
Asger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.motion-twin.com/pipermail/haxe/attachments/20061103/6b79c2c6/attachment-0001.htm
More information about the Haxe
mailing list