Sha256: 668cb7037c138368d96b0f384f889f112d61abd81df7bf24c072592ea08e37dc

Contents?: true

Size: 562 Bytes

Versions: 7

Compression:

Stored size: 562 Bytes

Contents

require 'curses'

module PM
class InfoWindow

  CONTENTS = File.join(File.dirname(__FILE__), 'info_window_contents.txt')

  include Curses

  attr_reader :win, :text

  TITLE = ' PatchMaster '

  def initialize(rows, cols, row, col)
    @win = Window.new(rows, cols, row, col)
    @text = IO.read(CONTENTS)
  end

  def draw
    @win.setpos(0, (@win.maxx() - TITLE.length) / 2)
    @win.attron(A_REVERSE) {
      @win.addstr(TITLE)
    }
    @win.addstr("\n")
    @text.each_line { |line| @win.addstr(line) }
  end

  def refresh
    @win.refresh
  end

end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
patchmaster-1.0.0 lib/patchmaster/curses/info_window.rb
patchmaster-0.0.6 lib/patchmaster/app/info_window.rb
patchmaster-0.0.5 lib/patchmaster/app/info_window.rb
patchmaster-0.0.4 lib/patchmaster/app/info_window.rb
patchmaster-0.0.3 lib/patchmaster/app/info_window.rb
patchmaster-0.0.2 lib/patchmaster/app/info_window.rb
patchmaster-0.0.1 lib/patchmaster/app/info_window.rb