107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# File 'lib/curses_extensions.rb', line 107
def addstr(str, color_name = nil, align = nil, ref = false)
if color_name && Curses::Color.pair(color_name)
attron(Curses::Color.pair(color_name))
end
case(align)
when :left
setpos(cury, 0)
when :right
setpos(cury, width - str.size)
when :center
setpos(cury, (width - str.size) / 2)
end
_orig_addstr(str)
if color_name && Curses::Color.pair(color_name)
attroff(Curses::Color.pair(color_name))
end
refresh if ref
end
|