def repaint
      $log.debug " form repaint:#{self}, #{@name} , r #{@row} c #{@col} " if $log.debug? 
      if @resize_required && @layout_manager
        @layout_manager.form = self unless @layout_manager.form
        @layout_manager.do_layout
        @resize_required = false
      end
      @widgets.each do |f|
        next if f.visible == false # added 2008-12-09 12:17 
        #$log.debug "XXX: FORM CALLING REPAINT OF WIDGET #{f} IN LOOP"
        #raise "Row or col nil #{f.row} #{f.col} for #{f}, #{f.name} " if f.row.nil? || f.col.nil?
        f.repaint
        f._object_created = true # added 2010-09-16 13:02 now prop handlers can be fired
      end
      
      _update_focusables if @focusable_modified
      #  this can bomb if someone sets row. We need a better way!
      if @row == -1 and @_firsttime == true
   
        select_first_field
        @_firsttime = false
      end
       setpos 
       # XXX this creates a problem if window is a pad
       # although this does show cursor movement etc.
       ### @window.wrefresh
       #if @window.window_type == :WINDOW
         #$log.debug " formrepaint #{@name} calling window.wrefresh #{@window} "
         @window.wrefresh
         Ncurses::Panel.update_panels ## added 2010-11-05 00:30 to see if clears the stdscr problems
       #else
         #$log.warn " XXX formrepaint #{@name} no refresh called  2011-09-19  #{@window} "
       #end
    end
def repaint
      $log.debug " form repaint:#{self}, #{@name} , r #{@row} c #{@col} " if $log.debug? 
      if @resize_required && @layout_manager
        @layout_manager.form = self unless @layout_manager.form
        @layout_manager.do_layout
        @resize_required = false
      end
      @widgets.each do |f|
        next if f.visible == false # added 2008-12-09 12:17 
        #$log.debug "XXX: FORM CALLING REPAINT OF WIDGET #{f} IN LOOP"
        #raise "Row or col nil #{f.row} #{f.col} for #{f}, #{f.name} " if f.row.nil? || f.col.nil?
        f.repaint
        f._object_created = true # added 2010-09-16 13:02 now prop handlers can be fired
      end
      
      _update_focusables if @focusable_modified
      #  this can bomb if someone sets row. We need a better way!
      if @row == -1 and @_firsttime == true
   
        select_first_field
        @_firsttime = false
      end
       setpos 
       # XXX this creates a problem if window is a pad
       # although this does show cursor movement etc.
       ### @window.wrefresh
       #if @window.window_type == :WINDOW
         #$log.debug " formrepaint #{@name} calling window.wrefresh #{@window} "
         @window.wrefresh
         Ncurses::Panel.update_panels ## added 2010-11-05 00:30 to see if clears the stdscr problems
       #else
         #$log.warn " XXX formrepaint #{@name} no refresh called  2011-09-19  #{@window} "
       #end
    end
form repaint,calls repaint on each widget which will repaint it only if it has been modified since last call.
 called after each keypress.