Storing the current terminal
[nfoiled.git] / examples / initialization.rb
blob5a8ac0e25c0bcd5585fde84264adeb9ded7500b1
1 ($:.unshift File.expand_path(File.join( File.dirname(__FILE__), '..', 'lib' ))).uniq!
2 require 'nfoiled'
4 ##
5 # This example provides a simple example of setting up an Ncurses interface,
6 # and then tearing it down. Nothing will be observed other than the clearing
7 # of the terminal for 10 seconds.
9 # First, we need to ensure that Ncurses will exit cleanly (that is, we don't
10 # want an interrupt or fatal error to screw up the terminal output after the
11 # program exists).
12 Nfoiled::initialize
14 # Finally, we have to update the display. This preforms the actual clearing of
15 # the screen.
16 ::Ncurses.doupdate
18 sleep 10