···137137 const count_text = try std.fmt.allocPrint(ctx.arena, "{d}", .{self.count});
138138 const text: vxfw.Text = .{ .text = count_text };
139139140140- // Each widget returns a Surface from it's draw function. A Surface contains the rectangular
140140+ // Each widget returns a Surface from its draw function. A Surface contains the rectangular
141141 // area of the widget, as well as some information about the surface or widget: can we focus
142142 // it? does it handle the mouse?
143143 //
144144- // It DOES NOT contain the location it should be within it's parent. Only the parent can set
144144+ // It DOES NOT contain the location it should be within its parent. Only the parent can set
145145 // this via a SubSurface. Here, we will return a Surface for the root widget (Model), which
146146 // has two SubSurfaces: one for the text and one for the button. A SubSurface is a Surface
147147 // with an offset and a z-index - the offset can be negative. This lets a parent draw a
···156156 .surface = try self.button.draw(ctx.withConstraints(
157157 ctx.min,
158158 // Here we explicitly set a new maximum size constraint for the Button. A Button will
159159- // expand to fill it's area and must have some hard limit in the maximum constraint
159159+ // expand to fill its area and must have some hard limit in the maximum constraint
160160 .{ .width = 16, .height = 3 },
161161 )),
162162 };
···173173 .widget = self.widget(),
174174 // We didn't actually need to draw anything for the root. In this case, we can set
175175 // buffer to a zero length slice. If this slice is *not zero length*, the runtime will
176176- // assert that it's length is equal to the size.width * size.height.
176176+ // assert that its length is equal to the size.width * size.height.
177177 .buffer = &.{},
178178 .children = children,
179179 };
···230230use the event loop of their choice. The event loop is responsible for reading
231231the TTY, passing the read bytes to the vaxis parser, and handling events.
232232233233-A core feature of Vaxis is it's ability to detect features via terminal queries
233233+A core feature of Vaxis is its ability to detect features via terminal queries
234234instead of relying on a terminfo database. This requires that the event loop
235235also handle these query responses and update the Vaxis.caps struct accordingly.
236236See the `Loop` implementation to see how this is done if writing your own event
+1-1
USAGE.md
···1212Everything after this can be left up to user code, or brought into an event loop
1313to be a more abstract application layer. One important part of handling the
1414events is to update the Vaxis struct with discovered terminal capabilities. This
1515-let's Vaxis know what features it can use. For example, the Kitty Keyboard
1515+lets Vaxis know what features it can use. For example, the Kitty Keyboard
1616protocol, in-band-resize reports, and Unicode width measurements are just a few
1717examples.
1818