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
idlok
  • References/Ruby on Rails/Ruby/Classes/Curses/Curses::Window

idlok(bool) Instance Public methods If bool is true

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

window.nodelay = bool Instance Public methods When in no-delay mode

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

delch() Instance Public methods Delete the character under the cursor

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

begx() Instance Public methods A getter for the beginning column (X coord) of

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

setpos(y, x) Instance Public methods A setter for the position of the cursor

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

refresh() Instance Public methods Refreshes the windows and lines.

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

addch(ch) Instance Public methods Add a character ch, with attributes

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

new(height, width, top, left) Class Public methods Contruct a new

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

box(vert, hor) Instance Public methods set the characters to frame the window

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

deleteln() Instance Public methods Delete the line under the cursor.

2025-01-10 15:47:30