class Belajar::Views::TopBar

Constants

HEIGHT

Attributes

height[R]
panel[R]
width[R]

Public Class Methods

new(window, text = '') click to toggle source
# File lib/belajar/views/top_bar.rb, line 10
def initialize(window, text = '')
  @height = HEIGHT
  @width  = window.maxx
  @panel  = create_panel(window, @width, @height, text)
end

Public Instance Methods

show() click to toggle source
# File lib/belajar/views/top_bar.rb, line 16
def show
  @panel.refresh
end

Private Instance Methods

create_panel(window, width, height, text) click to toggle source
# File lib/belajar/views/top_bar.rb, line 22
def create_panel(window, width, height, text)
  panel = window.subwin(height, width, 0, 0)

  panel.setpos(1, 1)
  panel.print_markdown(text)
  panel.setpos(2, 1)
  panel.clear_line(text: '_')

  panel
end