[REBOL] Re: Sticky Button Down State
From: greggirwin:mindspring at: 30-Jun-2003 22:28
Hi Daril,
DN> I can see the necessary extra work and code when programming for the
DN> real world. Sadly much simplicity and elegance are
DN> lost, especially after adding all the try/attempt code.
I don't have time to respond in proper detail, but don't forget that
this is true for any event driven system, not just REBOL (I'm
guessing you know that, so I say it for the benefit of lurkers who may
not). I remember reviewing VB apps suffering from cascading events and
unhandled multiply-triggered events (multivents? :).
So, what to do? In small apps, you can treat things specifically with
only minor pain and suffering but, as you point out, a loss of
elegance and simplicity.
In more complex situations another solution may be called for. I
haven't done it, but you could probably write styles that handle
multivents at least better than the raw styles do now.
My main tool against this kind of problem is a state machine. Events
are placed into a queue and dispatched from there. It means thinking
about things in a different way, and isn't always a good fit but it's
served me well in both VB and REBOL.
-- Gregg