Class: RTask::UI::CursesInterface

Inherits:
Object
  • Object
show all
Includes:
Curses
Defined in:
lib/rtask/ui/curses.rb

Defined Under Namespace

Modules: Attribute, Banner, Display, Main, Usage Classes: IncludedFiles

Instance Method Summary collapse

Constructor Details

#initialize(rtask) ⇒ CursesInterface

Returns a new instance of CursesInterface.



10
11
12
# File 'lib/rtask/ui/curses.rb', line 10

def initialize(rtask)
  @rtask = rtask
end

Instance Method Details

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rtask/ui/curses.rb', line 14

def start
  # init curses
  init_screen; start_color; cbreak; noecho; nl

  # init color
  define_color :banner, :white, :blue
  define_color :attribute, :blue, :black
  define_color :current_position, :red, :black
  define_color :required, :red, :black
  define_color :usage, :white, :blue

  # start the main window
  @main = stdscr
  @main.instance_variable_set(:@spec, @rtask.spec)
  @main.extend Main
  @main.start
end