module Daigaku::Views

Public Instance Methods

reset_menu_position() click to toggle source
# File lib/daigaku/views.rb, line 8
def reset_menu_position
  @position = 0
end

Private Instance Methods

default_window(height = nil, width = nil, top = 0, left = 0) click to toggle source
# File lib/daigaku/views.rb, line 14
def default_window(height = nil, width = nil, top = 0, left = 0)
  init_screen

  noecho
  crmode
  curs_set(0) # invisible cursor

  height ||= lines
  width  ||= cols + 1

  window = Daigaku::Window.new(height, width, top, left)

  Curses.lines.times do |line|
    window.setpos(line, 0)
    window.clear_line
  end

  window.keypad(true)
  window.scrollok(true)
  window.refresh
  window
end
sub_window_below_top_bar(window, top_bar) click to toggle source
# File lib/daigaku/views.rb, line 37
def sub_window_below_top_bar(window, top_bar)
  top_bar.show

  top        = top_bar.height
  sub_window = window.subwin(window.maxy - top, window.maxx, top, 0)

  sub_window.keypad(true)
  sub_window
end