PPCurses
Some convenience code to initialize curses and some rudimentary GUI classes. See the test directory for example programs.
Install
gem install 'ppcurses'
To use ppcurses with a ruby > 2.1.5 you must install the curses gem.
gem install 'curses'
Usage
require 'rubygems'
require 'ppcurses'
def displayMenu
mainMenu = PPCurses::Menu.new( [ "Press", "<ESCAPE>", "to Quit" ])
mainMenu.show
mainMenu.
mainMenu.close
end
screen = PPCurses::Screen.new
screen.run { displayMenu }
Curses and Ruby
There are several curses implementations for Ruby.
- 1. curses
-
This is the implementation that PPCurses uses. It was originally part of the Ruby standard library and later got pushed out of the standard libary into a gem.
- 2. ncurses-ruby
-
The heir to ncurses gem. It is under active development.
- 3. ncurses
-
Created by Earle Clubb this gem has been frozen at version 0.9.1 since 2004. You probably don’t want this gem, you probably want ncurses-ruby.
- 4. ffi-curses
-
A gem that makes curses available through FFI (foreign function interface), by Sean O’Halpin. The latest version is from 2011 (0.4.0).