896aae87cb
To make components similar to React components
23 lines
410 B
Ruby
23 lines
410 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Widgets
|
|
class Container < Curses::React::Component
|
|
def subwin(x, y, width, height)
|
|
window.subwin height, width, y, x
|
|
end
|
|
|
|
private
|
|
|
|
def render
|
|
children.each(&:draw)
|
|
end
|
|
|
|
def focus
|
|
raise NotImplementedError, "#{self.class}#focus"
|
|
end
|
|
|
|
def children
|
|
raise NotImplementedError, "#{self.class}#children"
|
|
end
|
|
end
|
|
end
|