Instance methods
add_char(chr, pos_y, pos_x)
Sourceadd_char(chr, position = nil)
Draw a character
Wrapper for waddch() and mvwaddch() (addch() and mvaddch())
Sourceattr_get
Get the current attributes and color pair
as a named tuple with attr and color
Wrapper for wattr_get() (attr_get())
Sourceattr_off(attr : Attribute)
Turn off attribute(s)
Wrapper for wattr_off() (attr_off())
Sourceattr_on(attr : Attribute)
Turn on attribute(s)
Wrapper for wattr_on() (attr_on())
Sourceattribute_off(attr : Attribute)
Sourceattribute_on(attr : Attribute)
Sourcechange_attribute(attr : Attribute = Attribute::Normal, color_pair = 0, length = -1, y = nil, x = nil)
attr is the Attribute enum.
color_pair is the color pair number (0 is the default white on black.)
length defaults to -1, but represents the number of characters to change, up to EOL.
If y and x are set, the cursor location is moved before changing attributes.
Wrapper for wchgat() and mvwchgat() (chgat() and mvchgat())
Sourceclear
Clear window
Wrapper for wclear() (clear())
Sourcedelete_window
Delete the window
Wrapper for delwin()
Sourceenclose?(y, x) : Bool
If a mouse position is in this window
Wrapper for wenclose()
Sourceenclose?(yx : NamedTuple) : Bool
Sourceenclose?(mouse_event : MouseEvent) : Bool
If a mouse event took place within this window
Sourceget_background
Get the character and attributes from the current background
Sourceget_char
Get a character input
Returned as Key if recognised, Char otherwise
Wrapper for wgetch() (getch())
Sourceget_char
Get a character input for main loop
Sourcekeypad(enable)
Enable or disable capturing function keys
Sourcemax_dimensions
Max height and width as tuple (y,x)
Sourcemax_dimensions_named
Max height and width as named tuple
Sourcemax_x
Return width
Wrapper for getmaxx()
Sourcemax_y
Return height
Wrapper for getmaxy()
Sourcemove(y, x)
Move cursor to new position
Wrapper for wmove() (move())
Sourcemove(new_pos : NamedTuple)
Sourcemove_window(y, x)
Move window relative to whole screen
TODO: Tuple version
Wrapper for mvwin()
Sourceno_delay
Do not wait for input, return ERR
Wrapper for nodelay()
Sourceno_timeout
Wait for input, no errors should be returned
Wrapper for notimeout()
Sourcenon_relative(event : MouseEvent) : MouseEvent
Sourceprint(message, pos_y, pos_x)
Sourceprint(message, position = nil)
Write a string
Wrapper for wprintw() and mvwprintw() (printw() and mvprintw())
Sourcerefresh
Refresh window
Wrapper for wrefresh() (refresh())
Sourcerelative(event : MouseEvent) : MouseEvent
Returns a new MouseEvent with coordinates relative to the window
To convert back user #non_relative
Sourceset_attr(attr : Attribute = Attribute::Normal, color_pair = 0)
Replace attribute(s) and color with these
Wrapper for wattr_set() (attr_set())
Sourceset_attribute(attr : Attribute = Attribute::Normal, color_pair = 0)
Sourceset_background(char)
Sets a new background and applies it everywhere
Sourceset_color(color_pair = 0)
Set this window's default color pair
Wrapper for wcolor_set() (color_set())
Sourceset_pos(new_pos : Tuple)
Sourceset_pos(new_pos : NamedTuple)
Sourcetimeout=(value)
Set input timeout
Wrapper for wtimeout() (timeout())
Sourcewith_attr(attrs : Attribute, &)
Block with attribute(s) turned on
Sourcewith_attribute(attrs : Attribute, &)
Source