Class: Blight::Window
- Inherits:
-
Object
- Object
- Blight::Window
- Defined in:
- lib/blight.rb
Instance Method Summary collapse
- #close ⇒ Object
- #height ⇒ Object
-
#initialize ⇒ Window
constructor
A new instance of Window.
- #open? ⇒ Boolean
- #print(string, x = x, y = y) ⇒ Object
- #refresh ⇒ Object
- #width ⇒ Object
- #x ⇒ Object
- #y ⇒ Object
Constructor Details
#initialize ⇒ Window
Returns a new instance of Window.
41 42 43 |
# File 'lib/blight.rb', line 41 def initialize @window = Ncurses.stdscr end |
Instance Method Details
#close ⇒ Object
70 71 72 |
# File 'lib/blight.rb', line 70 def close @closed = true end |
#height ⇒ Object
57 58 59 |
# File 'lib/blight.rb', line 57 def height Ncurses.getmaxy(@window) end |
#open? ⇒ Boolean
66 67 68 |
# File 'lib/blight.rb', line 66 def open? !@closed end |
#print(string, x = x, y = y) ⇒ Object
61 62 63 64 |
# File 'lib/blight.rb', line 61 def print(string, x = x, y = y) Ncurses.mvwprintw(@window, y, x, string) refresh end |
#refresh ⇒ Object
74 75 76 |
# File 'lib/blight.rb', line 74 def refresh Ncurses.refresh end |
#width ⇒ Object
53 54 55 |
# File 'lib/blight.rb', line 53 def width Ncurses.getmaxx(@window) end |
#x ⇒ Object
45 46 47 |
# File 'lib/blight.rb', line 45 def x Ncurses.getcurx(@window) end |
#y ⇒ Object
49 50 51 |
# File 'lib/blight.rb', line 49 def y Ncurses.getcury(@window) end |