allow_self_reference — permits changes to be written back to the point of origin.
allow_self_reference (symbol, allow)
This function tells Gamma not to generate a warning if a change function like on_change causes a sequence of events that changes the original point again.
This example is from LinearXform.g.
method LinearXform.AddLinearXform (app, src, dst, mult, add, bidirectional_p?=nil)
{
app.OnChange (src, `(@self).cbLinearXform (#@dst, value, @mult, @add));
if (bidirectional_p && mult != 0)
{
allow_self_reference (src, 1);
allow_self_reference (dst, 1);
app.OnChange (dst, `(@self).cbLinearXform (#@src, value, 1/@mult, (@-add)/(@mult)));
}
}Copyright © 1995-2011 by Cogent Real-Time Systems, Inc. All rights reserved.