Ruby Conio 1.1.0
Author: Gabriele Secci
- http://rubyforge.org/projects/conio
- http://rubygems.org/gems/conio
- http://google.code.com/p/rubyconio
DESCRIPTION
Ruby Conio 1.1.0 is a wrapper for Turbo C conio, used to create text user interfaces developed by Gabriele Secci.
The functions of "libconio.so" are implemented in C ANSI using the "libconio.a" library and "conio.h" header, available from the site: "http://conio.sourceforge.net". Module "libconio.so" is compiled with mingw32-gcc.
For the bug or various problem, please send me E-mail at: mailto:[email protected]
INSTALL
GEM File:
- $ gem install conio
EXE File:
- Double click in the exe file and follow the installation instruction.
EXAMPLE
This is a simple example of conio module.
require "conio"
# Set the console title
Conio.settitle("Ruby Conio 1.1.0 [test.rb]")
# Set the console window and buffer size
Conio.resize(80, 30)
# Hide cursor
Conio.setcursortype(Conio::CURSOR_HIDE)
# Put name module
Conio.write("Ruby Conio 1.1.0", 1, 0)
# Put name script
Conio.write("test.rb", 72, 0)
# Select cursor position
Conio.gotoxy(20, 29)
# Put copyright
print("Copyright \xa9 2010 RAGNETTO \xb8 Software")
# Put text attribute
Conio.fillattr(Conio::COLOR_WHITE, Conio::COLOR_RED, 80, 0, 0)
Conio.fillattr(Conio::COLOR_WHITE, Conio::COLOR_RED, 80, 0, 29)
# Print message
Conio.write("Press F1 to exit...", 1, 3)
# Stop program while users press F1...
while Conio.getkey() != Conio::KEY_F1
# nil
Conio.getkey()
end
# Count exit time
for index in (-4..-1) do
# Print message
Conio.write("Program exit in 4 seconds: #{index}", 1, 27)
# Exit before 4 seconds
Conio.sleep(1)
end
Show this code in test folder [test.rb]
DEVELOPER
- Author: Gabriele Secci - RAGNETTO Software
- Web: http://www.ragnetto.altervista.org
- E-mail: mailto:[email protected]
LICENSE
See LICENSE file.