lib/rbcurse/rcommandwindow.rb in rbcurse-1.2.0 vs lib/rbcurse/rcommandwindow.rb in rbcurse-1.3.0
- old
+ new
@@ -155,11 +155,11 @@
def destroy
$log.debug "DESTROY : rcommandwindow"
if @window
begin
panel = @window.panel
- Ncurses::Panel.del_panel(panel) if panel
+ Ncurses::Panel.del_panel(panel.pointer) if panel
@window.delwin
rescue => exc
end
end
end
@@ -246,12 +246,12 @@
else
config[:box] = @box
@to = ListObject.new self, text, config
end
yield @to if block_given?
- @to.display_interactive
- @to
+ @to.display_interactive # this returns the item selected
+ @to # this will return the ListObject to the user with list and current_index
end
# non interactive list display - EACH CALL IS CREATING A LIST OBJECT
def udisplay_list text, config={}
if @to
@to.content text
@@ -310,10 +310,11 @@
# maybe we should just use a textview or label rather than try to
# do it all voer again !
def display_interactive
display_content
while !@stop
+ @window.wrefresh # FFI 2011-09-12
# FIXME only clear and redisplay if change has happened (repaint_require)
handle_keys { |ch| @cw.clear; display_content }
end
return @list[@current_index]
end
@@ -522,9 +523,10 @@
row = r + (@current_index-@toprow)
# row should not be < r or greater than r+height TODO FIXME
#setrowcol row, nil
@window.wmove row, c
+ @window.wrefresh # FFI added to keep cursor display in synch with selection
end
def OLDbounds_check
@start = 0 if @start < 0
row_offset = 1
last = (@list.length)-(@height-row_offset-1)