# frozen_string_literal: true
module Widgets
class Base
attr_reader :parent
attr_reader :window
attr_reader :width, :height
attr_accessor :focused
def initialize(parent, x, y, width, height)
@parent = parent
@window = Curses::Window.new height, width, y, x
@width = width
@height = height
@focused = false
end
def trigger(event); end
def render
draw
window.refresh
def draw
raise NotImplementedError, "#{self.class}#draw"
def setpos(x, y)
window.setpos y, x
def addstr(s)
window.addstr s