forked from langhorst/rdialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
infobox.rb
executable file
·43 lines (35 loc) · 923 Bytes
/
infobox.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env ruby
# [email protected] Apr-20-2014
require [File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mrdialog'].join('/')
require 'pp'
class TestInfobox
ME = File.basename($0)
if ENV['CHANGE_TITLE']
if ME =~ /(.+)\.rb$/
base = $1
puts "\033]0;mrdialog - #{base}\007"
end
end
def initialize
end
def doit
dialog = MRDialog.new
dialog.logger = Logger.new(ENV["HOME"] + "/dialog_" + ME + ".log")
dialog.clear = true
dialog.title = "INFOBOX"
text = <<EOF
Hi, this is an information box. It is
different from a message box: it will
not pause waiting for input after displaying
the message. The pause here is only introduced
by the sleep command within dialog.
You have 10 seconds to read this...
EOF
dialog.sleep = 10
result = dialog.infobox(text, 10, 52)
puts "result: #{result}"
end
end
if __FILE__ == $0
TestInfobox.new.doit
end