Name
Curses::Window — Character-based window class
Synopsis
Curses::Window
is a class for character-based windows implemented by the
curses library.
Required Library
require "curses"
Class Method
Curses::Window::new(h,w,y,x)Creates a new
curseswindow of size (h,w) at position (y,x).
Instance Methods
w<<strw.addstr(str)Outputs
strto the screen.w.addch(ch)Outputs one character to the screen.
w.begxReturns the window’s beginning
xposition.w.begyReturns the window’s beginning
yposition.w.box(v,h)Draws a box around the window.
vis a character that draws a vertical side.his a character that draws a horizontal side.w.clearClears the window.
w.closeCloses the window.
w.curxReturns
xposition of the window’s cursor.w.curyReturns
yposition of the window’s cursor.w.delchDeletes a character at the window’s cursor position.
w.deletelnDeletes a line at the window’s cursor position.
w.getchReads one character from the keyboard.
w.getstrReads a line of string from the keyboard.
w.inchReads a character at the window’s cursor position.
w.insch(ch)Outputs one character before the window’s cursor.
w.maxxReturns the window’s
xsize.w.maxyReturns the window’s
ysize.w.move(y,x)Moves the window to the position (
y,x).w.refreshRefreshes the window.
w.setpos(y,x)Moves the window’s cursor to the position (
y,x).w.standendTurns on
standout(highlighting) mode in the window.w.standoutTurns off
standoutmode in the window.w.subwin(h,w,y,x)Creates a new
cursessubwindow of size (h,w) in the window ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access