class PM::InfoWindow

Constants

CONTENTS

Attributes

text[R]

Public Class Methods

new(rows, cols, row, col) click to toggle source
Calls superclass method
# File lib/patchmaster/curses/info_window.rb, line 12
def initialize(rows, cols, row, col)
  super(rows, cols, row, col, nil)
  @info_text = IO.read(CONTENTS)
  @text = nil
end

Public Instance Methods

draw() click to toggle source
Calls superclass method
# File lib/patchmaster/curses/info_window.rb, line 28
def draw
  super
  i = 1
  @text.each_line do |line|
    break if i >= @win.maxy - 2
    @win.setpos(i+1, 1)
    @win.addstr(make_fit(" #{line.chomp}"))
    i += 1
  end
end
text=(str) click to toggle source
# File lib/patchmaster/curses/info_window.rb, line 18
def text=(str)
  if str
    @text = str
    @title = 'Song Notes'
  else
    @text = @info_text
    @title = 'PatchMaster Help'
  end
end