Class: PM::HelpWindow
- Includes:
- Curses
- Defined in:
- lib/patchmaster/curses/help_window.rb
Constant Summary collapse
- CONTENTS =
File.join(File.dirname(__FILE__), 'info_window_contents.txt')
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Attributes inherited from PmWindow
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(rows, cols, row, col) ⇒ HelpWindow
constructor
A new instance of HelpWindow.
Methods inherited from PmWindow
#make_fit, #move_and_resize, #set_max_contents_len, #visible_height
Constructor Details
#initialize(rows, cols, row, col) ⇒ HelpWindow
Returns a new instance of HelpWindow.
12 13 14 15 16 |
# File 'lib/patchmaster/curses/help_window.rb', line 12 def initialize(rows, cols, row, col) super(rows, cols, row, col, nil) @text = IO.read(CONTENTS) @title = 'PatchMaster Help' end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/patchmaster/curses/help_window.rb', line 10 def text @text end |
Instance Method Details
#draw ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/patchmaster/curses/help_window.rb', line 18 def draw super i = 0 @text.each_line do |line| @win.setpos(i+2, 3) @win.addstr(make_fit(line.chomp)) i += 1 end end |