#nullable enable namespace Terminal.Gui.ViewBase; /// /// Represents a position that is computed by executing a function that returns an integer position. /// /// /// This is a low-level API that is typically used internally by the layout system. Use the various static /// methods on the class to create objects instead. /// /// The function that computes the position. If this function throws ... /// The returned from the function based on the passed view. public record PosFunc (Func Fn, View? View = null) : Pos { /// /// Gets the function that computes the position. /// public Func Fn { get; } = Fn; /// /// Gets the passed view that the position is based on. /// public View? View { get; } = View; /// public override string ToString () { return $"PosFunc({Fn (View)})"; } internal override int GetAnchor (int size) { return Fn (View); } }