Top Level Namespace

Includes:
Curses

Defined Under Namespace

Modules: Curses Classes: FileViewer

Instance Method Summary collapse

Methods included from Curses

ESCDELAY, ESCDELAY=, TABSIZE, TABSIZE=, addch, addstr, attroff, attron, attrset, beep, bkgd, bkgdset, can_change_color?, cbreak, clear, close_screen, closed?, clrtoeol, color_content, color_pair, color_pairs, colors, cols, crmode, curs_set, def_prog_mode, delch, deleteln, doupdate, echo, flash, getch, getmouse, getstr, has_colors?, inch, init_color, init_pair, init_screen, insch, insertln, keyname, lines, mouseinterval, mousemask, nl, nocbreak, nocrmode, noecho, nonl, noraw, pair_content, pair_number, raw, refresh, reset_prog_mode, resize, resizeterm, scrl, setpos, setscrreg, standend, standout, start_color, stdscr, timeout=, ungetch, ungetmouse, use_default_colors

Instance Method Details

#onsig(sig) ⇒ Object


7
8
9
10
# File 'rain.rb', line 7

def onsig(sig)
  close_screen
  exit sig
end

#ranfObject


12
13
14
# File 'rain.rb', line 12

def ranf
  rand(32767).to_f / 32767
end

#show_message(*msgs) ⇒ Object


6
7
8
9
10
11
12
13
14
15
16
# File 'hello.rb', line 6

def show_message(message)
  width = message.length + 6
  win = Window.new(5, width,
		   (lines - 5) / 2, (cols - width) / 2)
  win.box(?|, ?-)
  win.setpos(2, 3)
  win.addstr(message)
  win.refresh
  win.getch
  win.close
end