Sha256: 2c0b76310f3d671201c8c7abe873c0ee475c4af1787236a47f818cf90be355aa

Contents?: true

Size: 472 Bytes

Versions: 37

Compression:

Stored size: 472 Bytes

Contents

win = RubyText.window(10, 45, r: 1, c: 20, fg: Black, bg: Red)
win.puts "This very crude menu is also EXPERIMENTAL."
win.puts "It knows up, down, Enter, and Escape.\n "
win.puts "Press any key to display the menu..."
win.puts

getch

days = %w[Monday Tuesday Wednesday Thursday Friday]
num, day = win.menu(r: 1, c: 5, title: "Which day?", items: days)

puts
if day.nil?
  win.puts "You picked nothing!"
else
  win.puts "You picked item #{num} which is #{day.inspect}"
end

Version data entries

37 entries across 37 versions & 1 rubygems

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