forked from muquit/mrdialog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmsgbox.rb
More file actions
executable file
·38 lines (31 loc) · 800 Bytes
/
msgbox.rb
File metadata and controls
executable file
·38 lines (31 loc) · 800 Bytes
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
#!/usr/bin/env ruby
# muquit@muquit.com Apr-01-2014
require [File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mrdialog'].join('/')
require 'pp'
class TestMsgbox
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 = "MESSAGE BOX"
text = <<EOF
Hi, this is a simple message box. You can use this to \
display any message you like. The box will remain until \
you press the ENTER key.
EOF
result = dialog.msgbox(text, 10, 41)
puts "result: #{result}"
end
end
if __FILE__ == $0
TestMsgbox.new.doit
end