gleamtea/viewport

A bubble: a scrollable viewport over a block of text.

Types

An opaque viewport value.

pub type Viewport

Values

pub fn at_bottom(viewport: Viewport) -> Bool

Are we scrolled to the bottom?

pub fn at_top(viewport: Viewport) -> Bool

Are we scrolled to the top?

pub fn new(height height: Int) -> Viewport

A viewport showing height visible rows.

pub fn scroll_percent(viewport: Viewport) -> Float

How far through the content we are scrolled, as 0.01.0.

pub fn set_content(
  content: String,
  viewport: Viewport,
) -> Viewport

Replace the content (split into lines on \n).

pub fn update(
  msg: msg,
  viewport: Viewport,
) -> #(Viewport, gleamtea.Cmd(msg))

Scroll in response to a key.

pub fn view(viewport: Viewport) -> String

The visible window of lines.

Search Document