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.29 examples/multitest.rb
rubytext-0.1.28 examples/multitest.rb
rubytext-0.1.26 examples/multitest.rb
rubytext-0.1.25 examples/multitest.rb
rubytext-0.1.23 examples/multitest.rb
rubytext-0.1.22 examples/multitest.rb
rubytext-0.1.21 examples/multitest.rb
rubytext-0.1.20 examples/multitest.rb
rubytext-0.1.19 examples/multitest.rb
rubytext-0.1.18 examples/multitest.rb
rubytext-0.1.17 examples/multitest.rb
rubytext-0.1.16 examples/multitest.rb
rubytext-0.1.15 examples/multitest.rb
rubytext-0.1.14 examples/multitest.rb
rubytext-0.1.13 examples/multitest.rb
rubytext-0.1.12 examples/multitest.rb
rubytext-0.1.11 examples/multitest.rb
rubytext-0.1.10 examples/multitest.rb
rubytext-0.1.8 examples/multitest.rb
rubytext-0.1.7 examples/multitest.rb