Class: Diakonos::Window
- Defined in:
- lib/diakonos/window.rb
Instance Method Summary collapse
- #addstr(str) ⇒ Object
- #attrset(*args) ⇒ Object
- #curx ⇒ Object
- #cury ⇒ Object
- #getch ⇒ Object
-
#initialize(*args) ⇒ Window
constructor
A new instance of Window.
- #refresh ⇒ Object
- #setpos(row, col) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Window
Returns a new instance of Window.
6 7 8 9 10 11 |
# File 'lib/diakonos/window.rb', line 6 def initialize( *args ) # Setup some variables to keep track of a fake cursor @row, @col = 0, 0 super Curses::close_screen end |
Instance Method Details
#addstr(str) ⇒ Object
21 22 23 |
# File 'lib/diakonos/window.rb', line 21 def addstr( str ) @col += str.length end |
#attrset(*args) ⇒ Object
33 34 35 |
# File 'lib/diakonos/window.rb', line 33 def attrset( *args ) # noop end |
#curx ⇒ Object
25 26 27 |
# File 'lib/diakonos/window.rb', line 25 def curx @col end |
#cury ⇒ Object
29 30 31 |
# File 'lib/diakonos/window.rb', line 29 def cury @row end |
#getch ⇒ Object
37 38 39 |
# File 'lib/diakonos/window.rb', line 37 def getch $keystrokes.shift end |
#refresh ⇒ Object
13 14 15 |
# File 'lib/diakonos/window.rb', line 13 def refresh # Don't refresh when testing end |
#setpos(row, col) ⇒ Object
17 18 19 |
# File 'lib/diakonos/window.rb', line 17 def setpos( row, col ) @row, @col = row, col end |