Class: Intent::UI::Window
- Inherits:
-
Object
- Object
- Intent::UI::Window
- Defined in:
- lib/intent/ui/ttyui.rb
Instance Method Summary collapse
- #box_frame ⇒ Object
- #draw ⇒ Object
-
#initialize ⇒ Window
constructor
A new instance of Window.
- #split_horizontal(view1 = nil, view2 = nil) ⇒ Object
- #split_vertical(view1 = nil, view2 = nil) ⇒ Object
Constructor Details
Instance Method Details
#box_frame ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/intent/ui/ttyui.rb', line 58 def box_frame TTY::Box.frame( width: @width, height: @height, align: :center, border: :thick, style: { fg: :blue, border: { fg: :white, } } ) end |
#draw ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/intent/ui/ttyui.rb', line 73 def draw @cursor.clear_screen print box_frame @panels.each do |panel| @cursor.move_to print panel.draw end end |
#split_horizontal(view1 = nil, view2 = nil) ⇒ Object
53 54 55 56 |
# File 'lib/intent/ui/ttyui.rb', line 53 def split_horizontal(view1=nil, view2=nil) width = @width - 2 height = (@height / 2) - 2 end |