19 lines
288 B
Ruby
19 lines
288 B
Ruby
require "widget"
|
|
|
|
class BufferWidget
|
|
|
|
include Widget
|
|
|
|
def initialize(buffer, font)
|
|
@buffer = buffer
|
|
@font = font
|
|
end
|
|
|
|
def render
|
|
(0...@buffer.size).each do |i|
|
|
draw_text(@font, 0, @height - @font.line_height * (i + 1), @buffer[i], 1, 1, 1, 1)
|
|
end
|
|
end
|
|
|
|
end
|