rbcurse-core 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +10 -0
- data/VERSION +1 -1
- data/lib/rbcurse.rb +1 -1
- data/lib/rbcurse/core/include/bordertitle.rb +3 -1
- data/lib/rbcurse/core/include/chunk.rb +182 -180
- data/lib/rbcurse/core/include/io.rb +445 -443
- data/lib/rbcurse/core/include/listscrollable.rb +257 -254
- data/lib/rbcurse/core/include/vieditable.rb +153 -151
- data/lib/rbcurse/core/system/colormap.rb +146 -143
- data/lib/rbcurse/core/system/ncurses.rb +1 -1
- data/lib/rbcurse/core/util/ansiparser.rb +95 -93
- data/lib/rbcurse/core/util/colorparser.rb +58 -56
- data/lib/rbcurse/core/util/padreader.rb +151 -149
- data/lib/rbcurse/core/widgets/rlist.rb +6 -2
- data/lib/rbcurse/core/widgets/rtabbedwindow.rb +47 -45
- data/lib/rbcurse/core/widgets/textpad.rb +27 -18
- data/rbcurse-core.gemspec +2 -2
- metadata +2 -2
@@ -7,111 +7,113 @@
|
|
7
7
|
# Author: rkumar http://github.com/rkumar/rbcurse/
|
8
8
|
# Date: 07.11.11 - 13:17
|
9
9
|
# License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
|
10
|
-
# Last update: 2013-
|
10
|
+
# Last update: 2013-04-01 13:43
|
11
11
|
# ----------------------------------------------------------------------------- #
|
12
12
|
# == TODO
|
13
13
|
# - perhaps we can compile the regexp once and reuse
|
14
14
|
#
|
15
15
|
|
16
|
-
|
16
|
+
module RubyCurses
|
17
|
+
class AnsiParser
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
# NOTE: Experimental and minimal
|
20
|
+
# parses the formatted string and yields either an array of color, bgcolor and attrib
|
21
|
+
# or the text. This will be called by convert_to_chunk.
|
22
|
+
#
|
23
|
+
# Currently, assumes colors and attributes are correct. No error checking or fancy stuff.
|
24
|
+
# s="#[fg=green]hello there#[fg=yellow, bg=black, dim]"
|
25
|
+
# @since 1.4.1 2011-11-3 experimental, can change
|
26
|
+
# @return [nil] knows nothign about output format.
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
def parse_format s # yields attribs or text
|
29
|
+
## set default colors
|
30
|
+
color = :white
|
31
|
+
bgcolor = :black
|
32
|
+
attrib = FFI::NCurses::A_NORMAL
|
33
|
+
text = ""
|
33
34
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
## split #[...]
|
36
|
+
#a = s.split /(#\[[^\]]*\])/
|
37
|
+
a = s.split /(\x1b\[\d*(?:;\d+)*?[a-zA-Z])/
|
38
|
+
a.each { |e|
|
39
|
+
## process color or attrib portion
|
40
|
+
#[ "", "\e[1m", "", "\e[34m", "", "\e[47m", "Showing all items...", "\e[0m", "", "\e[0m", "\n"]
|
41
|
+
if e[0,1] == "\x1b" && e[-1,1] == "m"
|
41
42
|
|
42
|
-
|
43
|
+
#e.each { |f| x=/^.\[(.*).$/.match(f)
|
43
44
|
$log.debug "XXX: ANSI e #{e} "
|
44
45
|
x=/^.\[(.*).$/.match(e)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
46
|
+
color, bgcolor, attrib = nil, nil, nil
|
47
|
+
$log.debug "XXX: ANSI #{x} ..... #{x[1]} "
|
48
|
+
args = x[1].split ';'
|
49
|
+
## first split on commas to separate fg, bg and attr
|
50
|
+
# http://ascii-table.com/ansi-escape-sequences.php
|
51
|
+
args.each { |att|
|
52
|
+
$log.debug "XXX: ANSI att: #{att} "
|
53
|
+
case att.to_i
|
54
|
+
when 0
|
55
|
+
color, bgcolor, attrib = nil, nil, nil
|
56
|
+
yield :reset # actually this resets all so we need an endall or clearall reset
|
56
57
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
58
|
+
when 1
|
59
|
+
attrib = 'bold'
|
60
|
+
when 2
|
61
|
+
attrib = 'dim'
|
62
|
+
when 4
|
63
|
+
attrib = 'underline'
|
64
|
+
when 5
|
65
|
+
attrib = 'blink'
|
66
|
+
when 7
|
67
|
+
attrib = 'reverse'
|
68
|
+
when 8
|
69
|
+
attrib = 'hidden' # XXX
|
70
|
+
when 30
|
71
|
+
color = 'black'
|
72
|
+
when 31
|
73
|
+
color = 'red'
|
74
|
+
when 32
|
75
|
+
color = 'green'
|
76
|
+
when 33
|
77
|
+
color = 'yellow'
|
78
|
+
when 34
|
79
|
+
color = 'blue'
|
80
|
+
when 35
|
81
|
+
color = 'magenta'
|
82
|
+
when 36
|
83
|
+
color = 'cyan'
|
84
|
+
when 37
|
85
|
+
color = 'white'
|
85
86
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
87
|
+
#Background colors
|
88
|
+
when 40
|
89
|
+
bgcolor = 'black'
|
90
|
+
when 41
|
91
|
+
bgcolor = 'red'
|
92
|
+
when 42
|
93
|
+
bgcolor = 'green'
|
94
|
+
when 43
|
95
|
+
bgcolor = 'yellow'
|
96
|
+
when 44
|
97
|
+
bgcolor = 'blue'
|
98
|
+
when 45
|
99
|
+
bgcolor = 'magenta'
|
100
|
+
when 46
|
101
|
+
bgcolor = 'cyan'
|
102
|
+
when 47
|
103
|
+
bgcolor = 'white'
|
104
|
+
else
|
105
|
+
$log.warn "XXX: WARN ANSI not used #{att} "
|
106
|
+
end
|
107
|
+
} # args.ea
|
108
|
+
#} # e.each
|
109
|
+
$log.debug "XXX: ANSI YIELDING #{color} , #{bgcolor} , #{attrib} "
|
110
|
+
yield [color,bgcolor,attrib] if block_given?
|
111
|
+
else
|
112
|
+
text = e
|
113
|
+
yield text if block_given?
|
114
|
+
end
|
115
|
+
} # a.each
|
116
|
+
end
|
116
117
|
|
118
|
+
end
|
117
119
|
end
|
@@ -7,69 +7,71 @@
|
|
7
7
|
# Author: rkumar http://github.com/rkumar/rbcurse/
|
8
8
|
# Date: 07.11.11 - 13:17
|
9
9
|
# License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
|
10
|
-
# Last update: 2013-
|
10
|
+
# Last update: 2013-04-01 13:42
|
11
11
|
# ----------------------------------------------------------------------------- #
|
12
12
|
# == TODO
|
13
13
|
# - perhaps we can compile the regexp once and reuse
|
14
14
|
#
|
15
15
|
|
16
|
-
|
16
|
+
module RubyCurses
|
17
|
+
class DefaultColorParser
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
19
|
+
# NOTE: Experimental and minimal
|
20
|
+
# parses the formatted string and yields either an array of color, bgcolor and attrib
|
21
|
+
# or the text. This will be called by convert_to_chunk.
|
22
|
+
#
|
23
|
+
# Currently, assumes colors and attributes are correct. No error checking or fancy stuff.
|
24
|
+
# s="#[fg=green]hello there#[fg=yellow, bg=black, dim]"
|
25
|
+
# @since 1.4.1 2011-11-3 experimental, can change
|
26
|
+
# @return [nil] knows nothign about output format.
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# 187compat 2013-03-20 - 19:33 not working in 187 so added ,1 in some cases for string
|
29
|
+
def parse_format s # yields attribs or text
|
30
|
+
## set default colors
|
31
|
+
color = :white
|
32
|
+
bgcolor = :black
|
33
|
+
attrib = FFI::NCurses::A_NORMAL
|
34
|
+
text = ""
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
36
|
+
## split #[...]
|
37
|
+
a = s.split /(#\[[^\]]*\])/
|
38
|
+
a.each { |e|
|
39
|
+
## process color or attrib portion
|
40
|
+
if e[0,2] == "#[" && e[-1,1] == "]"
|
41
|
+
# now resetting 1:20 PM November 3, 2011 , earlier we were carrying over
|
42
|
+
color, bgcolor, attrib = nil, nil, nil
|
43
|
+
catch(:done) do
|
44
|
+
e = e[2..-2]
|
45
|
+
## first split on commas to separate fg, bg and attr
|
46
|
+
atts = e.split /\s*,\s*/
|
47
|
+
atts.each { |att|
|
48
|
+
## next split on =
|
49
|
+
part = att.split /\s*=\s*/
|
50
|
+
case part[0]
|
51
|
+
when "fg"
|
52
|
+
color = part[1]
|
53
|
+
when "bg"
|
54
|
+
bgcolor = part[1]
|
55
|
+
when "/end", "end"
|
56
|
+
yield :endcolor if block_given?
|
57
|
+
#next
|
58
|
+
throw :done
|
59
|
+
else
|
60
|
+
# attrib
|
61
|
+
attrib = part[0]
|
62
|
+
end
|
63
|
+
}
|
64
|
+
# 2013-03-25 - 13:31 if numeric color specified
|
65
|
+
color = color.to_i if color =~ /^[0-9]+$/
|
66
|
+
bgcolor = bgcolor.to_i if bgcolor =~ /^[0-9]+$/
|
67
|
+
yield [color,bgcolor,attrib] if block_given?
|
68
|
+
end # catch
|
69
|
+
else
|
70
|
+
text = e
|
71
|
+
yield text if block_given?
|
72
|
+
end
|
73
|
+
}
|
74
|
+
end
|
74
75
|
|
76
|
+
end
|
75
77
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* Author: rkumar (http://github.com/rkumar/rbcurse/)
|
5
5
|
* Date: 22.10.11 - 20:35
|
6
6
|
* License: Same as Ruby's License (http://www.ruby-lang.org/LICENSE.txt)
|
7
|
-
* Last update:
|
7
|
+
* Last update: 2013-04-01 13:43
|
8
8
|
|
9
9
|
== CHANGES
|
10
10
|
== TODO
|
@@ -17,164 +17,166 @@
|
|
17
17
|
require 'rbcurse'
|
18
18
|
|
19
19
|
include RubyCurses
|
20
|
-
|
20
|
+
module RubyCurses
|
21
|
+
class PadReader
|
21
22
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
# You may pass height, width, row and col for creating a window otherwise a fullscreen window
|
24
|
+
# will be created. If you pass a window from caller then that window will be used.
|
25
|
+
# Some keys are trapped, jkhl space, pgup, pgdown, end, home, t b
|
26
|
+
# This is currently very minimal and was created to get me started to integrating
|
27
|
+
# pads into other classes such as textview.
|
28
|
+
def initialize config={}, &block
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
h = config.fetch(:height, 0)
|
37
|
-
w = config.fetch(:width, 0)
|
38
|
-
t = config.fetch(:row, 0)
|
39
|
-
l = config.fetch(:col, 0)
|
40
|
-
@rows = h unless h == 0
|
41
|
-
@cols = w unless w == 0
|
42
|
-
@startrow = t unless t == 0
|
43
|
-
@startcol = l unless l == 0
|
44
|
-
@suppress_border = config[:suppress_border]
|
45
|
-
unless @suppress_border
|
46
|
-
@startrow += 1
|
47
|
-
@startcol += 1
|
48
|
-
@rows -=3 # 3 is since print_border_only reduces one from width, to check whether this is correct
|
49
|
-
@cols -=3
|
50
|
-
end
|
51
|
-
@top = t
|
52
|
-
@left = l
|
53
|
-
view_file config[:filename]
|
54
|
-
@window = config[:window] || VER::Window.new(:height => h, :width => w, :top => t, :left => l)
|
55
|
-
# print border reduces on from width for some historical reason
|
56
|
-
@window.print_border_only @top, @left, h-1, w, $datacolor
|
57
|
-
@ph = @content_rows
|
58
|
-
@pw = @content_cols # get max col
|
59
|
-
@pad = FFI::NCurses.newpad(@ph, @pw)
|
30
|
+
@config = config
|
31
|
+
@rows = FFI::NCurses.LINES-1
|
32
|
+
@cols = FFI::NCurses.COLS-1
|
33
|
+
@prow = @pcol = 0
|
34
|
+
@startrow = 0
|
35
|
+
@startcol = 0
|
60
36
|
|
61
|
-
|
62
|
-
|
37
|
+
h = config.fetch(:height, 0)
|
38
|
+
w = config.fetch(:width, 0)
|
39
|
+
t = config.fetch(:row, 0)
|
40
|
+
l = config.fetch(:col, 0)
|
41
|
+
@rows = h unless h == 0
|
42
|
+
@cols = w unless w == 0
|
43
|
+
@startrow = t unless t == 0
|
44
|
+
@startcol = l unless l == 0
|
45
|
+
@suppress_border = config[:suppress_border]
|
46
|
+
unless @suppress_border
|
47
|
+
@startrow += 1
|
48
|
+
@startcol += 1
|
49
|
+
@rows -=3 # 3 is since print_border_only reduces one from width, to check whether this is correct
|
50
|
+
@cols -=3
|
51
|
+
end
|
52
|
+
@top = t
|
53
|
+
@left = l
|
54
|
+
view_file config[:filename]
|
55
|
+
@window = config[:window] || VER::Window.new(:height => h, :width => w, :top => t, :left => l)
|
56
|
+
# print border reduces on from width for some historical reason
|
57
|
+
@window.print_border_only @top, @left, h-1, w, $datacolor
|
58
|
+
@ph = @content_rows
|
59
|
+
@pw = @content_cols # get max col
|
60
|
+
@pad = FFI::NCurses.newpad(@ph, @pw)
|
63
61
|
|
64
|
-
|
65
|
-
|
66
|
-
@window.wrefresh
|
67
|
-
padrefresh
|
68
|
-
#FFI::NCurses.prefresh(@pad, 0,0, @startrow ,@startcol, @rows,@cols);
|
62
|
+
Ncurses::Panel.update_panels
|
63
|
+
@content.each_index { |ix|
|
69
64
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
65
|
+
FFI::NCurses.mvwaddstr(@pad,ix, 0, @content[ix])
|
66
|
+
}
|
67
|
+
@window.wrefresh
|
68
|
+
padrefresh
|
69
|
+
#FFI::NCurses.prefresh(@pad, 0,0, @startrow ,@startcol, @rows,@cols);
|
75
70
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
@content_cols = content_cols()
|
82
|
-
#run()
|
83
|
-
end
|
84
|
-
# write pad onto window
|
85
|
-
private
|
86
|
-
def padrefresh
|
87
|
-
FFI::NCurses.prefresh(@pad,@prow,@pcol, @startrow,@startcol, @rows + @startrow,@cols+@startcol);
|
88
|
-
end
|
89
|
-
# returns button index
|
90
|
-
# Call this after instantiating the window
|
91
|
-
public
|
92
|
-
def run
|
93
|
-
#@form.repaint
|
94
|
-
#@window.wrefresh
|
95
|
-
return handle_keys
|
96
|
-
end
|
71
|
+
@window.bkgd(Ncurses.COLOR_PAIR(5));
|
72
|
+
FFI::NCurses.keypad(@pad, true);
|
73
|
+
#@form = Form.new @window
|
74
|
+
config[:row] = config[:col] = 0 # ??? XXX
|
75
|
+
end
|
97
76
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
77
|
+
private
|
78
|
+
def view_file(filename)
|
79
|
+
@file = filename
|
80
|
+
@content = File.open(filename,"r").readlines
|
81
|
+
@content_rows = @content.count
|
82
|
+
@content_cols = content_cols()
|
83
|
+
#run()
|
84
|
+
end
|
85
|
+
# write pad onto window
|
86
|
+
private
|
87
|
+
def padrefresh
|
88
|
+
FFI::NCurses.prefresh(@pad,@prow,@pcol, @startrow,@startcol, @rows + @startrow,@cols+@startcol);
|
89
|
+
end
|
90
|
+
# returns button index
|
91
|
+
# Call this after instantiating the window
|
92
|
+
public
|
93
|
+
def run
|
94
|
+
#@form.repaint
|
95
|
+
#@window.wrefresh
|
96
|
+
return handle_keys
|
97
|
+
end
|
107
98
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
99
|
+
# convenience method
|
100
|
+
private
|
101
|
+
def key x
|
102
|
+
x.getbyte(0)
|
103
|
+
end
|
104
|
+
def content_cols
|
105
|
+
longest = @content.max_by(&:length)
|
106
|
+
longest.length
|
107
|
+
end
|
108
|
+
|
109
|
+
# returns button index
|
110
|
+
private
|
111
|
+
def handle_keys
|
112
|
+
ht = @window.height.ifzero FFI::NCurses.LINES-1
|
113
|
+
buttonindex = catch(:close) do
|
114
|
+
@maxrow = @content_rows - @rows
|
115
|
+
@maxcol = @content_cols - @cols
|
116
|
+
while((ch = @window.getchar()) != FFI::NCurses::KEY_F10 )
|
117
|
+
#while((ch = FFI::NCurses.wgetch(@pad)) != FFI::NCurses::KEY_F10 )
|
118
|
+
break if ch == ?\C-q.getbyte(0)
|
119
|
+
begin
|
120
|
+
case ch
|
121
|
+
when key(?g), 279 # home as per iterm2
|
122
|
+
@prow = 0
|
123
|
+
when key(?b), key(?G), 277 # end as per iterm2
|
124
|
+
@prow = @maxrow-1
|
125
|
+
when key(?j)
|
126
|
+
@prow += 1
|
127
|
+
when key(?k)
|
128
|
+
@prow -= 1
|
129
|
+
when 32, 338 # Page Down abd Page Up as per iTerm2
|
130
|
+
@prow += 10
|
131
|
+
when key(?\C-d)
|
132
|
+
@prow += ht
|
133
|
+
when key(?\C-b)
|
134
|
+
@prow -= ht
|
135
|
+
when 339
|
136
|
+
@prow -= 10
|
137
|
+
when key(?l)
|
138
|
+
@pcol += 1
|
139
|
+
when key(?$)
|
140
|
+
@pcol = @maxcol - 1
|
141
|
+
when key(?h)
|
142
|
+
@pcol -= 1
|
143
|
+
when key(?0)
|
144
|
+
@pcol = 0
|
145
|
+
when key(?q)
|
146
|
+
throw :close
|
147
|
+
else
|
148
|
+
alert " #{ch} not mapped "
|
149
|
+
end
|
150
|
+
@prow = 0 if @prow < 0
|
151
|
+
@pcol = 0 if @pcol < 0
|
152
|
+
if @prow > @maxrow-1
|
153
|
+
@prow = @maxrow-1
|
154
|
+
end
|
155
|
+
if @pcol > @maxcol-1
|
156
|
+
@pcol = @maxcol-1
|
157
|
+
end
|
158
|
+
#@window.wclear
|
159
|
+
#FFI::NCurses.prefresh(@pad,@prow,@pcol, @startrow,0, @rows,@cols);
|
160
|
+
padrefresh
|
161
|
+
Ncurses::Panel.update_panels
|
162
|
+
#@form.handle_key(ch)
|
163
|
+
#@window.wrefresh
|
164
|
+
rescue => err
|
165
|
+
$log.debug( err) if err
|
166
|
+
$log.debug(err.backtrace.join("\n")) if err
|
166
167
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
168
|
+
textdialog ["Error in padreader: #{err} ", *err.backtrace], :title => "Exception"
|
169
|
+
$error_message.value = ""
|
170
|
+
ensure
|
171
|
+
end
|
171
172
|
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
173
|
+
end # while loop
|
174
|
+
end # close
|
175
|
+
$log.debug "XXX: CALLER GOT #{buttonindex} "
|
176
|
+
@window.destroy unless @config[:window]
|
177
|
+
FFI::NCurses.delwin(@pad)
|
178
|
+
return buttonindex
|
179
|
+
end
|
178
180
|
end
|
179
181
|
end
|
180
182
|
if __FILE__ == $PROGRAM_NAME
|