Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/widgets/container.rb
Braiden Vasco 896aae87cb Rename Curses::React::Component#draw to #render, #render to #draw
To make components similar to React components
2017-07-28 00:02:59 +00:00

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