Module: Ncurses

Defined in:
lib/tagen/ncurses.rb,
lib/tagen/ncurses.rb,
lib/tagen/ncurses.rb

Overview

WINDOW

Defined Under Namespace

Classes: Key, WINDOW

Class Method Summary (collapse)

Class Method Details

+ (Object) end

end ncurses

call echo nocbreak nl endwin

See Also:

  • selfself.new


70
71
72
73
74
75
# File 'lib/tagen/ncurses.rb', line 70

def self.end
	echo
	nocbreak
	nl
	endwin
end

+ (Object) new(&blk)

a convient function.

setup initscr cbreak nonl noecho

Examples:

new do |stdsrc|
	..
end


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/tagen/ncurses.rb', line 48

def self.new &blk 
	begin
		initscr
		cbreak
		nonl
		noecho

		stdscr.intrflush(false)
		stdscr.keypad(true)   

		blk.call stdscr if blk
	ensure
		self.end if blk
	end
	stdscr
end