You can set attributes with Curses::Window#attrset
. Here's an example:
require "curses"
include Curses
init_screen
begin
attrs = {
A_NORMAL => 'Normal display (no highlight)',
A_STANDOUT => 'Best highlighting mode of the terminal.',
A_UNDERLINE => 'Underlining',
A_REVERSE => 'Reverse video',
A_BLINK => 'Blinking',
A_DIM => 'Half bright',
A_BOLD => 'Extra bright or bold',
A_PROTECT => 'Protected mode',
A_INVIS => 'Invisible or blank mode',
A_ALTCHARSET => 'Alternate character set',
}
attrs.each { |a, s|
attrset(a)
addstr("#{s}\n")
}
refresh
getch
ensure
close_screen
end