class Curses::Window
Attributes
attr[RW]
bg[RW]
fg[RW]
locate[RW]
nohistory[RW]
pager[RW]
pager_cmd[RW]
pager_more[RW]
text[RW]
update[RW]
Public Instance Methods
clr()
click to toggle source
General extensions (see github.com/isene/Ruby-Curses-Class-Extension)
# File bin/astropanel, line 509 def clr self.setpos(0, 0) self.maxy.times {self.deleteln()} self.refresh self.setpos(0, 0) end
fill()
click to toggle source
# File bin/astropanel, line 515 def fill # Fill window with color as set by :bg self.setpos(0, 0) self.bg = 0 if self.bg == nil self.fg = 255 if self.fg == nil init_pair(self.fg, self.fg, self.bg) blank = " " * self.maxx self.maxy.times {self.attron(color_pair(self.fg)) {self << blank}} self.refresh self.setpos(0, 0) end
p(fg, bg, attr, text)
click to toggle source
# File bin/astropanel, line 534 def p(fg, bg, attr, text) init_pair(fg, fg, bg) self.attron(color_pair(fg) | attr) { self << text } self.refresh end
write()
click to toggle source
# File bin/astropanel, line 525 def write # Write context of :text to window with attributes :attr self.bg = 0 if self.bg == nil self.fg = 255 if self.fg == nil init_pair(self.fg, self.fg, self.bg) self.attr = 0 if self.attr == nil self.attron(color_pair(self.fg) | self.attr) { self << self.text } self.refresh self.text = "" end