Sha256: c5d5ace53c8570677c9098e263a1ed1cf3ddefd7a9919aaf7792ac7c08246263

Contents?: true

Size: 674 Bytes

Versions: 42

Compression:

Stored size: 674 Bytes

Contents

require 'rubytext'

RubyText.start(fg: White, bg: Black)

def any_key
  STDSCR.bottom
  print " "*30 + "Press any key..."
  getch
end

puts "Colors...\n "  # window must be >= 96 cols?

r0 = 3
Colors.each do |fg|
  c0 = 0
  Colors.each do |bg|
    win = RubyText.window(2, 12, r: r0, c: c0, border: false, fg: fg, bg: bg)
    win.puts " #{fg} on\n #{bg}"
    c0 += 14
  end
  r0 += 3
end

any_key

STDSCR.clear

15.times { puts }

puts "Here is some"
puts "  random text...\n "
sleep 2.5

STDSCR.scrolling(true)

puts "Scroll up 3..."
3.times { STDSCR.scroll; sleep 0.9 }

sleep 0.9

puts "... now scroll down 5."
5.times { STDSCR.scroll(-1); sleep 0.9 }

sleep 0.9
any_key

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
rubytext-0.1.6 examples/multitest.rb
rubytext-0.1.5 examples/multitest.rb
rubytext-0.1.4 examples/multitest.rb
rubytext-0.1.3 examples/multitest.rb
rubytext-0.1.2 examples/multitest.rb
rubytext-0.1.1 examples/multitest.rb
rubytext-0.1.0 examples/multitest.rb
rubytext-0.0.99 examples/multitest.rb
rubytext-0.0.98 examples/multitest.rb
rubytext-0.0.97 examples/multitest.rb
rubytext-0.0.96 examples/multitest.rb
rubytext-0.0.95 examples/multitest.rb
rubytext-0.0.94 examples/multitest.rb
rubytext-0.0.93 examples/multitest.rb
rubytext-0.0.92 examples/multitest.rb
rubytext-0.0.91 examples/multitest.rb
rubytext-0.0.90 examples/multitest.rb
rubytext-0.0.89 examples/multitest.rb
rubytext-0.0.88 examples/multitest.rb
rubytext-0.0.87 examples/multitest.rb