struct

Phosphor::Frame

Inherits Struct < Value < Object

Represents a rectangular region of the terminal.

All rendering is frame-relative: widgets write cells at frame.x + local_col, frame.y + local_row. The Buffer translates those into absolute terminal coordinates when emitting ANSI moves. In fullscreen mode the root frame's origin is (0, 0); in inline mode it's wherever the cursor was when the app started. Widgets, View, and Screen never know which mode is in use.

Constructors

new(origin_row : Int32, origin_col : Int32, width : Int32, height : Int32)
Source

Instance methods

height
Source
inset(n : Int32) : Frame

Returns a new Frame shrunk by n cells on each edge.

BorderMock uses this to hand the inner region to its child widget: the mock draws border cells around the frame's perimeter, then calls child.render(frame.inset(1), buf).

Source
origin_col
Source
origin_row
Source
width
Source
x

Convenience alias for origin_col. Used alongside #y in render code.

Source
y

Convenience alias for origin_row. Used alongside #x in render code.

Source