Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

circling around the ncurses compatibility shim

  • Loading branch information...
commit 0f041fed7a51852c812132debadef7350c3c596d 1 parent b3022e6
@seanohalpin authored
Showing with 13 additions and 7 deletions.
  1. +11 −6 examples/ncurses-example.rb
  2. +2 −1  notes/ncurses-shim-todo.org
View
17 examples/ncurses-example.rb
@@ -103,9 +103,10 @@ def method_missing(name, *args)
def respond_to?(name)
name = name.to_s
if (name[0,2] == "mv" && FFI::NCurses.respond_to?("mvw" + name[2..-1]))
- return true
+ true
+ else
+ FFI::NCurses.respond_to?("w" + name) || FFI::NCurses.respond_to?(name)
end
- FFI::NCurses.respond_to?("w" + name) || FFI::NCurses.respond_to?(name)
end
def del
FFI::NCurses.delwin(@win)
@@ -175,10 +176,14 @@ def two_borders()
Ncurses.cbreak # provide unbuffered input
Ncurses.noecho # turn off input echoing
Ncurses.nonl # turn off newline translation
-# Ncurses.stdscr.intrflush(false) # turn off flush-on-interrupt
-# Ncurses.stdscr.keypad(true) # turn on keypad mode
-# Ncurses.stdscr.addstr("Press a key to continue") # output string
-# Ncurses.stdscr.getch # get a charachter
+
+ # Need bool branch to fix this
+
+ # Ncurses.stdscr.intrflush(false) # turn off flush-on-interrupt
+ # Ncurses.stdscr.keypad(true) # turn on keypad mode
+ # Ncurses.stdscr.addstr("Press a key to continue") # output string
+ # Ncurses.stdscr.getch # get a charachter
+
Ncurses.stdscr.intrflush(Ncurses::FALSE) # turn off flush-on-interrupt
Ncurses.stdscr.keypad(Ncurses::TRUE) # turn on keypad mode
Ncurses.addstr("Press a key to continue") # output string
View
3  notes/ncurses-shim-todo.org
@@ -1,5 +1,6 @@
-= Ncurses shim
+* Ncurses shim
- so JRuby can require 'ncurses'
- win pointer as WINDOW class
- COLS = getmaxx
+ See [[../examples/ncurses-example.rb]] for a first stab.
Please sign in to comment.
Something went wrong with that request. Please try again.