repo.or.cz
/
rbx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Change soft-fail to use the config, rather than env
[rbx.git]
/
stdlib
/
ext
/
curses
/
hello.rb
blob
7f57d801a3ca82cb6351a67a90ab3b7cd89f573c
1
#!/usr/local/bin/ruby
2
3
require "curses"
4
include Curses
5
6
def show_message(message)
7
width = message.length + 6
8
win = Window.new(5, width,
9
(lines - 5) / 2, (cols - width) / 2)
10
win.box(?|, ?-)
11
win.setpos(2, 3)
12
win.addstr(message)
13
win.refresh
14
win.getch
15
win.close
16
end
17
18
init_screen
19
begin
20
crmode
21
# show_message("Hit any key")
22
setpos((lines - 5) / 2, (cols - 10) / 2)
23
addstr("Hit any key")
24
refresh
25
getch
26
show_message("Hello, World!")
27
refresh
28
ensure
29
close_screen
30
end