rbcurse-core 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -127,7 +127,7 @@ module VER
127
127
  $stderr.puts @last_error, *@last_error.backtrace
128
128
  end
129
129
  require 'rbcurse/core/system/colormap'
130
- include ColorMap
130
+ include RubyCurses::ColorMap
131
131
  end
132
132
  module Ncurses
133
133
  extend self
@@ -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-03-21 00:44
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
- class AnsiParser
16
+ module RubyCurses
17
+ class AnsiParser
17
18
 
18
- # NOTE: Experimental and minimal
19
- # parses the formatted string and yields either an array of color, bgcolor and attrib
20
- # or the text. This will be called by convert_to_chunk.
21
- #
22
- # Currently, assumes colors and attributes are correct. No error checking or fancy stuff.
23
- # s="#[fg=green]hello there#[fg=yellow, bg=black, dim]"
24
- # @since 1.4.1 2011-11-3 experimental, can change
25
- # @return [nil] knows nothign about output format.
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
- def parse_format s # yields attribs or text
28
- ## set default colors
29
- color = :white
30
- bgcolor = :black
31
- attrib = FFI::NCurses::A_NORMAL
32
- text = ""
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
- ## split #[...]
35
- #a = s.split /(#\[[^\]]*\])/
36
- a = s.split /(\x1b\[\d*(?:;\d+)*?[a-zA-Z])/
37
- a.each { |e|
38
- ## process color or attrib portion
39
- #[ "", "\e[1m", "", "\e[34m", "", "\e[47m", "Showing all items...", "\e[0m", "", "\e[0m", "\n"]
40
- if e[0,1] == "\x1b" && e[-1,1] == "m"
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
- #e.each { |f| x=/^.\[(.*).$/.match(f)
43
+ #e.each { |f| x=/^.\[(.*).$/.match(f)
43
44
  $log.debug "XXX: ANSI e #{e} "
44
45
  x=/^.\[(.*).$/.match(e)
45
- color, bgcolor, attrib = nil, nil, nil
46
- $log.debug "XXX: ANSI #{x} ..... #{x[1]} "
47
- args = x[1].split ';'
48
- ## first split on commas to separate fg, bg and attr
49
- # http://ascii-table.com/ansi-escape-sequences.php
50
- args.each { |att|
51
- $log.debug "XXX: ANSI att: #{att} "
52
- case att.to_i
53
- when 0
54
- color, bgcolor, attrib = nil, nil, nil
55
- yield :reset # actually this resets all so we need an endall or clearall reset
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
- when 1
58
- attrib = 'bold'
59
- when 2
60
- attrib = 'dim'
61
- when 4
62
- attrib = 'underline'
63
- when 5
64
- attrib = 'blink'
65
- when 7
66
- attrib = 'reverse'
67
- when 8
68
- attrib = 'hidden' # XXX
69
- when 30
70
- color = 'black'
71
- when 31
72
- color = 'red'
73
- when 32
74
- color = 'green'
75
- when 33
76
- color = 'yellow'
77
- when 34
78
- color = 'blue'
79
- when 35
80
- color = 'magenta'
81
- when 36
82
- color = 'cyan'
83
- when 37
84
- color = 'white'
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
- #Background colors
87
- when 40
88
- bgcolor = 'black'
89
- when 41
90
- bgcolor = 'red'
91
- when 42
92
- bgcolor = 'green'
93
- when 43
94
- bgcolor = 'yellow'
95
- when 44
96
- bgcolor = 'blue'
97
- when 45
98
- bgcolor = 'magenta'
99
- when 46
100
- bgcolor = 'cyan'
101
- when 47
102
- bgcolor = 'white'
103
- else
104
- $log.warn "XXX: WARN ANSI not used #{att} "
105
- end
106
- } # args.ea
107
- #} # e.each
108
- $log.debug "XXX: ANSI YIELDING #{color} , #{bgcolor} , #{attrib} "
109
- yield [color,bgcolor,attrib] if block_given?
110
- else
111
- text = e
112
- yield text if block_given?
113
- end
114
- } # a.each
115
- end
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-03-25 13:32
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
- class DefaultColorParser
16
+ module RubyCurses
17
+ class DefaultColorParser
17
18
 
18
- # NOTE: Experimental and minimal
19
- # parses the formatted string and yields either an array of color, bgcolor and attrib
20
- # or the text. This will be called by convert_to_chunk.
21
- #
22
- # Currently, assumes colors and attributes are correct. No error checking or fancy stuff.
23
- # s="#[fg=green]hello there#[fg=yellow, bg=black, dim]"
24
- # @since 1.4.1 2011-11-3 experimental, can change
25
- # @return [nil] knows nothign about output format.
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
- # 187compat 2013-03-20 - 19:33 not working in 187 so added ,1 in some cases for string
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 = ""
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
- ## split #[...]
36
- a = s.split /(#\[[^\]]*\])/
37
- a.each { |e|
38
- ## process color or attrib portion
39
- if e[0,2] == "#[" && e[-1,1] == "]"
40
- # now resetting 1:20 PM November 3, 2011 , earlier we were carrying over
41
- color, bgcolor, attrib = nil, nil, nil
42
- catch(:done) do
43
- e = e[2..-2]
44
- ## first split on commas to separate fg, bg and attr
45
- atts = e.split /\s*,\s*/
46
- atts.each { |att|
47
- ## next split on =
48
- part = att.split /\s*=\s*/
49
- case part[0]
50
- when "fg"
51
- color = part[1]
52
- when "bg"
53
- bgcolor = part[1]
54
- when "/end", "end"
55
- yield :endcolor if block_given?
56
- #next
57
- throw :done
58
- else
59
- # attrib
60
- attrib = part[0]
61
- end
62
- }
63
- # 2013-03-25 - 13:31 if numeric color specified
64
- color = color.to_i if color =~ /^[0-9]+$/
65
- bgcolor = bgcolor.to_i if bgcolor =~ /^[0-9]+$/
66
- yield [color,bgcolor,attrib] if block_given?
67
- end # catch
68
- else
69
- text = e
70
- yield text if block_given?
71
- end
72
- }
73
- end
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: 2011-11-14 - 20:57
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
- class PadReader
20
+ module RubyCurses
21
+ class PadReader
21
22
 
22
- # You may pass height, width, row and col for creating a window otherwise a fullscreen window
23
- # will be created. If you pass a window from caller then that window will be used.
24
- # Some keys are trapped, jkhl space, pgup, pgdown, end, home, t b
25
- # This is currently very minimal and was created to get me started to integrating
26
- # pads into other classes such as textview.
27
- def initialize config={}, &block
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
- @config = config
30
- @rows = FFI::NCurses.LINES-1
31
- @cols = FFI::NCurses.COLS-1
32
- @prow = @pcol = 0
33
- @startrow = 0
34
- @startcol = 0
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
- Ncurses::Panel.update_panels
62
- @content.each_index { |ix|
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
- FFI::NCurses.mvwaddstr(@pad,ix, 0, @content[ix])
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
- @window.bkgd(Ncurses.COLOR_PAIR(5));
71
- FFI::NCurses.keypad(@pad, true);
72
- #@form = Form.new @window
73
- config[:row] = config[:col] = 0 # ??? XXX
74
- end
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
- private
77
- def view_file(filename)
78
- @file = filename
79
- @content = File.open(filename,"r").readlines
80
- @content_rows = @content.count
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
- # convenience method
99
- private
100
- def key x
101
- x.getbyte(0)
102
- end
103
- def content_cols
104
- longest = @content.max_by(&:length)
105
- longest.length
106
- end
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
- # returns button index
109
- private
110
- def handle_keys
111
- ht = @window.height.ifzero FFI::NCurses.LINES-1
112
- buttonindex = catch(:close) do
113
- @maxrow = @content_rows - @rows
114
- @maxcol = @content_cols - @cols
115
- while((ch = @window.getchar()) != FFI::NCurses::KEY_F10 )
116
- #while((ch = FFI::NCurses.wgetch(@pad)) != FFI::NCurses::KEY_F10 )
117
- break if ch == ?\C-q.getbyte(0)
118
- begin
119
- case ch
120
- when key(?g), 279 # home as per iterm2
121
- @prow = 0
122
- when key(?b), key(?G), 277 # end as per iterm2
123
- @prow = @maxrow-1
124
- when key(?j)
125
- @prow += 1
126
- when key(?k)
127
- @prow -= 1
128
- when 32, 338 # Page Down abd Page Up as per iTerm2
129
- @prow += 10
130
- when key(?\C-d)
131
- @prow += ht
132
- when key(?\C-b)
133
- @prow -= ht
134
- when 339
135
- @prow -= 10
136
- when key(?l)
137
- @pcol += 1
138
- when key(?$)
139
- @pcol = @maxcol - 1
140
- when key(?h)
141
- @pcol -= 1
142
- when key(?0)
143
- @pcol = 0
144
- when key(?q)
145
- throw :close
146
- else
147
- alert " #{ch} not mapped "
148
- end
149
- @prow = 0 if @prow < 0
150
- @pcol = 0 if @pcol < 0
151
- if @prow > @maxrow-1
152
- @prow = @maxrow-1
153
- end
154
- if @pcol > @maxcol-1
155
- @pcol = @maxcol-1
156
- end
157
- #@window.wclear
158
- #FFI::NCurses.prefresh(@pad,@prow,@pcol, @startrow,0, @rows,@cols);
159
- padrefresh
160
- Ncurses::Panel.update_panels
161
- #@form.handle_key(ch)
162
- #@window.wrefresh
163
- rescue => err
164
- $log.debug( err) if err
165
- $log.debug(err.backtrace.join("\n")) if err
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
- textdialog ["Error in padreader: #{err} ", *err.backtrace], :title => "Exception"
168
- $error_message.value = ""
169
- ensure
170
- end
168
+ textdialog ["Error in padreader: #{err} ", *err.backtrace], :title => "Exception"
169
+ $error_message.value = ""
170
+ ensure
171
+ end
171
172
 
172
- end # while loop
173
- end # close
174
- $log.debug "XXX: CALLER GOT #{buttonindex} "
175
- @window.destroy unless @config[:window]
176
- FFI::NCurses.delwin(@pad)
177
- return buttonindex
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