Sha256: 3aed9b85d5acfcd308371d4d6799df5d0e7f6c0e62fe2a85318b19c58669c8e3

Contents?: true

Size: 666 Bytes

Versions: 11

Compression:

Stored size: 666 Bytes

Contents

require "curses"
include Curses

module PPCurses

  # Screen initializes the Curses screen 
  # Pass a code block to the run method to start things
	class Screen 

    # Creates a curses session
    #
    # Example:
    #   >> myScreen.run { displayMenu() }
    #
    def run( )
      begin
        init_screen
        Curses.raw
        clear
        curs_set(0) # Makes cursor invisible
        noecho
        cbreak
        start_color
      
        yield 
        
      rescue SystemExit, Interrupt
        # Empty Catch block so ruby doesn't puke out
        # a stack trace when CTRL-C is used
      ensure
        close_screen
      end
    end 

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ppcurses-0.0.20 lib/ppcurses/Screen.rb
ppcurses-0.0.19 lib/ppcurses/Screen.rb
ppcurses-0.0.18 lib/ppcurses/Screen.rb
ppcurses-0.0.17 lib/ppcurses/Screen.rb
ppcurses-0.0.16 lib/ppcurses/Screen.rb
ppcurses-0.0.15 lib/ppcurses/Screen.rb
ppcurses-0.0.14 lib/ppcurses/Screen.rb
ppcurses-0.0.13 lib/ppcurses/Screen.rb
ppcurses-0.0.12 lib/ppcurses/Screen.rb
ppcurses-0.0.11 lib/ppcurses/Screen.rb
ppcurses-0.0.10 lib/ppcurses/Screen.rb