Sha256: 4e6d6e98c3c25082474124331a22e85a9a62c5f3085b8511a8bccf6de2bac33e
Contents?: true
Size: 574 Bytes
Versions: 52
Compression:
Stored size: 574 Bytes
Contents
#!/usr/bin/env ruby require "curses" def show_message(message) height = 5 width = message.length + 6 top = (Curses.lines - height) / 2 left = (Curses.cols - width) / 2 win = Curses::Window.new(height, width, top, left) win.box("|", "-") win.setpos(2, 3) win.addstr(message) win.refresh win.getch win.close end Curses.init_screen begin Curses.crmode Curses.setpos((Curses.lines - 1) / 2, (Curses.cols - 11) / 2) Curses.addstr("Hit any key") Curses.refresh Curses.getch show_message("Hello, World!") ensure Curses.close_screen end
Version data entries
52 entries across 52 versions & 1 rubygems