Travis Griggs wrote:
> So I have this view hooked up to an ObservedList. The fallback case is
> that if I get a ValueChanged, redraw the whole view. But I'd like to
> make the view a little more efficient. When someone does an at:put:,
> ideally I just redraw the part of the view that is relative to that
> index. So I could subscribe to the ElementsReplaced. But the rub is...
> how do I set up my view to respond to an ElementsReplaced when it
> happens and ignore the associated ValueChanged, but still respond to the
> ValueChanged when it's not in conjunction with an ElementsReplaced?
The sequence is:
ValueAboutToChange
ValueChanging
ElementsReplaced
ValueChanged
(and I tried to have it consistent for all such cases in that
ValueChanged is always the last--if any are not, let me know).
So one solution is to have a flag 'ignoreNextValueChanged' that you set
when responding to ElementsReplaced and on receipt of ValueChanged you
don't redraw if it's set (and reset the flag).
--
Vassili Bykov <
[hidden email]>
[:s | s, s printString] value: '[s: | s, s printString] value: '