Class: Diakonos::Window

Inherits:
Curses::Window
  • Object
show all
Defined in:
lib/diakonos/window.rb

Instance Method Summary collapse

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

#curxObject



25
26
27
# File 'lib/diakonos/window.rb', line 25

def curx
  @col
end

#curyObject



29
30
31
# File 'lib/diakonos/window.rb', line 29

def cury
  @row
end

#getchObject



37
38
39
# File 'lib/diakonos/window.rb', line 37

def getch
  $keystrokes.shift
end

#refreshObject



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