Skip to contents

Lays out and paints a widget tree into a ScreenBuffer without a terminal. Useful for snapshot tests and for checking layouts interactively.

Usage

render_widget(x, width = 80L, height = 24L)

Arguments

x

A widget, a Screen or an App.

width, height

Screen size in cells.

Value

A ScreenBuffer; use $to_text() for plain text.

Examples

buf <- render_widget(vertical(label("a"), label("b")), 10, 2)
buf$to_text()
#> [1] "a         " "b         "