def repaint
    return unless @repaint_required  # 2010-11-20 13:13 its writing over a window i think TESTING
    if @label_unattached
      alert "came here unattachd"
      @label.set_form(@form)
      @label_unattached = nil
    end
    if @label_unplaced
      alert "came here unplaced"
      position_label
      @label_unplaced = nil
    end
    #@bgcolor ||= $def_bg_color
    #@color   ||= $def_fg_color
    _color = color()
    _bgcolor = bgcolor()
    $log.debug("repaint FIELD: #{id}, #{name}, #{row} #{col},pcol:#{@pcol},  #{focusable} st: #{@state} ")
    @width = 1 if width == 0
    printval = getvalue_for_paint().to_s # added 2009-01-06 23:27 
    printval = mask()*printval.length unless @mask.nil?
    if !printval.nil? 
      if printval.length > width # only show maxlen
        printval = printval[@pcol..@pcol+width-1] 
      else
        printval = printval[@pcol..-1]
      end
    end
  
    acolor = @color_pair || get_color($datacolor, _color, _bgcolor)
    if @state == :HIGHLIGHTED
      _bgcolor = @highlight_bgcolor || _bgcolor
      _color = @highlight_color || _color
      acolor = get_color(acolor, _color, _bgcolor)
    end
    @graphic = @form.window if @graphic.nil? ## cell editor listbox hack 
    #$log.debug " Field g:#{@graphic}. r,c,displen:#{@row}, #{@col}, #{@width} c:#{@color} bg:#{@bgcolor} a:#{@attr} :#{@name} "
    r = row
    c = col
    @graphic.printstring r, c, sprintf("%-*s", width, printval), acolor, attr()
    @field_col = c
    @repaint_required = false
  end
def repaint
    return unless @repaint_required  # 2010-11-20 13:13 its writing over a window i think TESTING
    if @label_unattached
      alert "came here unattachd"
      @label.set_form(@form)
      @label_unattached = nil
    end
    if @label_unplaced
      alert "came here unplaced"
      position_label
      @label_unplaced = nil
    end
    #@bgcolor ||= $def_bg_color
    #@color   ||= $def_fg_color
    _color = color()
    _bgcolor = bgcolor()
    $log.debug("repaint FIELD: #{id}, #{name}, #{row} #{col},pcol:#{@pcol},  #{focusable} st: #{@state} ")
    @width = 1 if width == 0
    printval = getvalue_for_paint().to_s # added 2009-01-06 23:27 
    printval = mask()*printval.length unless @mask.nil?
    if !printval.nil? 
      if printval.length > width # only show maxlen
        printval = printval[@pcol..@pcol+width-1] 
      else
        printval = printval[@pcol..-1]
      end
    end
  
    acolor = @color_pair || get_color($datacolor, _color, _bgcolor)
    if @state == :HIGHLIGHTED
      _bgcolor = @highlight_bgcolor || _bgcolor
      _color = @highlight_color || _color
      acolor = get_color(acolor, _color, _bgcolor)
    end
    @graphic = @form.window if @graphic.nil? ## cell editor listbox hack 
    #$log.debug " Field g:#{@graphic}. r,c,displen:#{@row}, #{@col}, #{@width} c:#{@color} bg:#{@bgcolor} a:#{@attr} :#{@name} "
    r = row
    c = col
    @graphic.printstring r, c, sprintf("%-*s", width, printval), acolor, attr()
    @field_col = c
    @repaint_required = false
  end
Note that some older widgets like Field repaint every time the form.repaint
+ is called, whether updated or not. I can't remember why this is, but
+ currently I've not implemented events with these widgets. 2010-01-03 15:00