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