Class: Ncurses::IWindow

Inherits:
Object
  • Object
show all
Defined in:
lib/ektoplayer/icurses/ncurses.rb

Instance Method Summary collapse

Constructor Details

#initialize(w) ⇒ IWindow

Returns a new instance of IWindow.



7
8
9
# File 'lib/ektoplayer/icurses/ncurses.rb', line 7

def initialize(w)
   @w = w
end

Instance Method Details

#attrset(attributes) ⇒ Object

FIX: ‘attrset’ in ncurses seems broken?



43
44
45
46
47
# File 'lib/ektoplayer/icurses/ncurses.rb', line 43

def attrset(attributes)
   Ncurses.send(:wattr_get, @w, old_a=[], old_c=[], nil)
   Ncurses.send(:wattroff, @w, old_a[0] | old_c[0])
   Ncurses.send(:wattron, @w, attributes)
end

#getchObject



11
12
13
14
15
16
17
# File 'lib/ektoplayer/icurses/ncurses.rb', line 11

def getch
   return Ncurses::wgetch(self)
   y, x = Ncurses::getcury(self), Ncurses::getcurx(self)
   c = Ncurses::wgetch(self)
   Ncurses::wmove(self, y, x)
   c
end