Type:
Class

Description

The means by which to create and manage frames or windows. While there may be more than one window at a time, only one window will receive input.

Usage

require 'curses'

Curses.init_screen()

my_str = "LOOK! PONIES!"
win = Curses::Window.new( 8, (my_str.length + 10),
                          (Curses.lines - 8) / 2,
                          (Curses.cols - (my_str.length + 10)) / 2 )
win.box("|", "-")
win.setpos(2,3)
win.addstr(my_str)
# or even
win << "\nORLY"
win << "\nYES!! " + my_str
win.refresh
win.getch
win.close
inch
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

inch() Instance Public methods Returns the character at the current position

2025-01-10 15:47:30
scroll
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

scroll() Instance Public methods Scrolls the current window up one line.

2025-01-10 15:47:30
clrtoeol
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

clrtoeol() Instance Public methods Clear the window to the end of line, that

2025-01-10 15:47:30
scrollok
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

scrollok(bool) Instance Public methods Controls what happens when the cursor

2025-01-10 15:47:30
cury
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

cury() Instance Public methods A getter for the current line (Y coord) of the

2025-01-10 15:47:30
keypad
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

keypad(bool) Instance Public methods Enables the keypad of the user's terminal

2025-01-10 15:47:30
insch
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

insch(ch) Instance Public methods Insert a character ch, before

2025-01-10 15:47:30
clear
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

clear() Instance Public methods Clear the window.

2025-01-10 15:47:30
setscrreg
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

setscrreg(top, bottom) Instance Public methods

2025-01-10 15:47:30
standend
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

standend() Instance Public methods Enables the Normal display (no highlight)

2025-01-10 15:47:30