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/window.rb
2017-07-22 15:37:22 +00:00

24 lines
531 B
Ruby

# frozen_string_literal: true
module Widgets
class Window < Container
attr_reader :focus
def initialize(x, y, width, height)
super
@menu = Widgets::Menu.new 0, 0, nil, Curses.stdscr.maxy
@messenger = Widgets::Messenger.new @menu.width, 0, Curses.stdscr.maxx - @menu.width, Curses.stdscr.maxy
self.focus = @messenger
end
def children
[@menu, @messenger]
end
def trigger(event)
focus.trigger event
end
end
end