Class: Ruvi::Ruler
Instance Attribute Summary
Attributes inherited from Widget
#buffer, #cursor, #parent
Instance Method Summary
collapse
Methods inherited from Widget
#initialize
Constructor Details
This class inherits a constructor from Ruvi::Widget
Instance Method Details
#height ⇒ Object
179
|
# File 'lib/widgets.rb', line 179
def height; nil; end
|
#render(y) ⇒ Object
183
184
185
186
187
188
189
190
|
# File 'lib/widgets.rb', line 183
def render y
screen = canvas
screen.setpos y, 0 screen.set_attr true, Curses::COLOR_WHITE, Curses::COLOR_BLACK
valid_line = (@buffer.top + y) < @buffer.lines.length
str = valid_line ? "#{@buffer.top + y}" : ""
screen.addstr str.rjust(screen.maxx - 2)
end
|
#watch_buffer ⇒ Object
180
181
182
|
# File 'lib/widgets.rb', line 180
def watch_buffer
@buffer
end
|
#width ⇒ Object
178
|
# File 'lib/widgets.rb', line 178
def width; 10; end
|