Module: Ncurses
- Defined in:
- lib/sup/buffer.rb
Constant Summary collapse
- KEY_ENTER =
10
- KEY_CANCEL =
ctrl-g
7
- KEY_TAB =
9
Class Method Summary collapse
- .cols ⇒ Object
- .curx ⇒ Object
- .mutex ⇒ Object
-
.nonblocking_getch ⇒ Object
magically, this stuff seems to work now.
- .rows ⇒ Object
- .sync(&b) ⇒ Object
Class Method Details
.cols ⇒ Object
13 14 15 16 17 |
# File 'lib/sup/buffer.rb', line 13 def cols lame, lamer = [], [] stdscr.getmaxyx lame, lamer lamer.first end |
.curx ⇒ Object
19 20 21 22 23 |
# File 'lib/sup/buffer.rb', line 19 def curx lame, lamer = [], [] stdscr.getyx lame, lamer lamer.first end |
.mutex ⇒ Object
25 |
# File 'lib/sup/buffer.rb', line 25 def mutex; @mutex ||= Mutex.new; end |
.nonblocking_getch ⇒ Object
magically, this stuff seems to work now. i could swear it didn’t before. hm.
30 31 32 33 34 35 36 |
# File 'lib/sup/buffer.rb', line 30 def nonblocking_getch if IO.select([$stdin], nil, nil, 1) Ncurses.getch else nil end end |
.rows ⇒ Object
7 8 9 10 11 |
# File 'lib/sup/buffer.rb', line 7 def rows lame, lamer = [], [] stdscr.getmaxyx lame, lamer lame.first end |
.sync(&b) ⇒ Object
26 |
# File 'lib/sup/buffer.rb', line 26 def sync &b; mutex.synchronize(&b); end |