def repaint
      return unless @repaint_required
      raise "Label row or col nil #{@row} , #{@col}, #{@text} " if @row.nil? || @col.nil?
      r,c = rowcol

      #@bgcolor ||= $def_bg_color
      #@color   ||= $def_fg_color
      _bgcolor = bgcolor()
      _color = color()
      # value often nil so putting blank, but usually some application error
      value = getvalue_for_paint || ""

      if value.is_a? Array
        value = value.join " "
      end
      # ensure we do not exceed
      if @width
        if value.length > @width
          value = value[0..@width-1]
        end
      end
      len = @width || value.length
      #acolor = get_color $datacolor
      # the user could have set color_pair, use that, else determine color
      # This implies that if he sets cp, then changing col and bg won't have an effect !
      # A general routine that only changes color will not work here.
      acolor = @color_pair || get_color($datacolor, _color, _bgcolor)
      #$log.debug "label :#{@text}, #{value}, r #{r}, c #{c} col= #{@color}, #{@bgcolor} acolor  #{acolor} j:#{@justify} dlL: #{@width} "
      str = @justify.to_sym == :right ? "%*s" : "%-*s"  # added 2008-12-22 19:05 
    
      @graphic ||= @form.window
      # clear the area
      @graphic.printstring r, c, " " * len , acolor, attr()
      if @justify.to_sym == :center
        padding = (@width - value.length)/2
        value = " "*padding + value + " "*padding # so its cleared if we change it midway
      end
      @graphic.printstring r, c, str % [len, value], acolor, attr()
      if @mnemonic
        ulindex = value.index(@mnemonic) || value.index(@mnemonic.swapcase)
        @graphic.mvchgat(y=r, x=c+ulindex, max=1, Ncurses::A_BOLD|Ncurses::A_UNDERLINE, acolor, nil)
      end
      @repaint_required = false
    end
def repaint
      return unless @repaint_required
      raise "Label row or col nil #{@row} , #{@col}, #{@text} " if @row.nil? || @col.nil?
      r,c = rowcol

      #@bgcolor ||= $def_bg_color
      #@color   ||= $def_fg_color
      _bgcolor = bgcolor()
      _color = color()
      # value often nil so putting blank, but usually some application error
      value = getvalue_for_paint || ""

      if value.is_a? Array
        value = value.join " "
      end
      # ensure we do not exceed
      if @width
        if value.length > @width
          value = value[0..@width-1]
        end
      end
      len = @width || value.length
      #acolor = get_color $datacolor
      # the user could have set color_pair, use that, else determine color
      # This implies that if he sets cp, then changing col and bg won't have an effect !
      # A general routine that only changes color will not work here.
      acolor = @color_pair || get_color($datacolor, _color, _bgcolor)
      #$log.debug "label :#{@text}, #{value}, r #{r}, c #{c} col= #{@color}, #{@bgcolor} acolor  #{acolor} j:#{@justify} dlL: #{@width} "
      str = @justify.to_sym == :right ? "%*s" : "%-*s"  # added 2008-12-22 19:05 
    
      @graphic ||= @form.window
      # clear the area
      @graphic.printstring r, c, " " * len , acolor, attr()
      if @justify.to_sym == :center
        padding = (@width - value.length)/2
        value = " "*padding + value + " "*padding # so its cleared if we change it midway
      end
      @graphic.printstring r, c, str % [len, value], acolor, attr()
      if @mnemonic
        ulindex = value.index(@mnemonic) || value.index(@mnemonic.swapcase)
        @graphic.mvchgat(y=r, x=c+ulindex, max=1, Ncurses::A_BOLD|Ncurses::A_UNDERLINE, acolor, nil)
      end
      @repaint_required = false
    end
label's repaint - I am removing wrapping and Array stuff and making it simple 2011-11-12