class BBS::Petscii::Screen

The screen of one call on a line-by-line board, and the ways such a board talks: a reversed title bar, pages of text that wait for RETURN, numbered cursor lists (BBS::Selector), single-key and cursor menus, a line field (BBS::Field) and the full-screen editor (BBS::Editor).

It is made for a Commodore 64, a 40×25 screen on a session switched with session.petscii!, which makes PETSCII of what the screen writes. Given cols and rows it serves a modern terminal too: on a session that is not PETSCII, cls homes the cursor and the text is not made plain.

The colours are the ANSI constants of BBS::Petscii::Colors, included, so a subclass writes WH, LG … bare. A board subclasses it for methods of its own:

class Screen < BBS::Petscii::Screen
  def banner(text) = puts(" #{YE}#{text}#{LG}")
end

screen = Screen.new(runner.session)
screen.title('the shelves', 'q: back')
book = screen.pick('the shelves', books, &:title)