A Squeak/Smalltalk-based programming environment and framework that supports low-effort construction of graphical tools by employing a data-driven perspective and a script-based programming model.
MIT License
58
stars
9
forks
source link
Pane-cycle detection: Restoring ActiveEvent can fail #294
In ViPane >> #beginUpdateChainWith: we reset ActiveEvent to begin a chain of pane updates programmatically in the model's #updateChildren.
(This is the second approach. The first one is event-based. See ViPane >> #beginUpdateChain using the ActiveEvent itself as update identifier to detect cyclic updates.).
However, resetting the value of ActiveEvent in an ensure-block does -- sometimes -- mix up with the system's #becomeActiveDuring:, which will then leave ActiveEvent not-nil in Morphic's deferred UI messages. In that case, Object >> #currentEvent does not yield the last input event but the value of non-nil ActiveEvent, which will be the same in deferred UI messages. Forever.
In
ViPane >> #beginUpdateChainWith:
we resetActiveEvent
to begin a chain of pane updates programmatically in the model's#updateChildren
.(This is the second approach. The first one is event-based. See
ViPane >> #beginUpdateChain
using theActiveEvent
itself as update identifier to detect cyclic updates.).However, resetting the value of
ActiveEvent
in an ensure-block does -- sometimes -- mix up with the system's#becomeActiveDuring:
, which will then leaveActiveEvent
not-nil in Morphic's deferred UI messages. In that case,Object >> #currentEvent
does not yield the last input event but the value of non-nilActiveEvent
, which will be the same in deferred UI messages. Forever.