Module: RubyTUI::Widget

Overview

Widget protocol for immediate-mode rendering. Any object with #render(area, buf) is a widget. Include this module for documentation and a default NotImplementedError.

Instance Method Summary collapse

Instance Method Details

#render(area, buf) ⇒ void

This method returns an undefined value.

Render this widget into the buffer at the given area.

Including classes override this method.

Parameters:

  • area (Rect) —

    the rectangular area to render into

  • buf (Buffer) —

    the buffer to write cells into

Raises:

  • (NotImplementedError) —

    always, unless overridden by the including class



16
17
18
# File 'lib/rubytui/widget.rb', line 16

def render(area, buf)
  raise NotImplementedError, "#{self.class}#render(area, buf) not implemented"
end