def repaint graphic, r=@row,c=@col, row_index=-1, treearraynode=nil, value=@text, leaf=nil, focussed=false, selected=false, expanded=false
        #$log.debug "label :#{@text}, #{value}, #{r}, #{c} col= #{@color}, #{@bgcolor} acolor= #{acolor} j:#{@justify} dlL: #{@display_length} "

      prepare_default_colors focussed, selected

        value=value.to_s # ??
        #icon = object.is_leaf? ? "-" : "+"
        #icon = leaf ? "-" : "+"

        #level = treearraynode.level
        #node = treearraynode.node
        level = treearraynode.level
        node = treearraynode
        if parent.node_expanded? node
          icon = PLUS_MINUS  # can collapse
        else
          icon = PLUS_PLUS   # can expand
        end
        if node.children.size == 0
          icon = PLUS_Q # either no children or not visited yet
          if parent.has_been_expanded node
            icon = PLUS_MINUS # definitely no children, we've visited
          end
        end
        # adding 2 to level, that's the size of icon
        # XXX FIXME if we put the icon here, then when we scroll right, the icon will show, it shoud not
        # FIXME we ignore truncation etc on previous level and take the object as is !!!
        _value =  "%*s %s" % [ level+2, icon,  node.user_object ]
        @actual_length = _value.length
        pcol = @pcol
        if pcol > 0
          _len = @display_length || @parent.width-2
          _value = _value[@pcol..@pcol+_len-1] 
        end
        _value ||= ""
        if @height && @height > 1
        else
          # ensure we do not exceed
          if !@display_length.nil?
            if _value.length > @display_length
              @actual_length = _value.length
              _value = _value[0..@display_length-1]
            end
          end
          #lablist << value
        end
        len = @display_length || _value.length
        graphic.printstring r, c, "%-*s" % [len, _value], @color_pair,@attr
        #_height = @height || 1
        #0.upto(_height-1) { |i| 
          #graphic.printstring r+i, c, ( " " * len) , @color_pair,@attr
        #}
        #lablist.each_with_index do |_value, ix|
          #break if ix >= _height
          #if @justify.to_sym == :center
            #padding = (@display_length - _value.length)/2
            #_value = " "*padding + _value + " "*padding # so its cleared if we change it midway
          #end
          #graphic.printstring r, c, str % [len, _value], @color_pair,@attr
          #r += 1
        #end
    end
def repaint graphic, r=@row,c=@col, row_index=-1, treearraynode=nil, value=@text, leaf=nil, focussed=false, selected=false, expanded=false
        #$log.debug "label :#{@text}, #{value}, #{r}, #{c} col= #{@color}, #{@bgcolor} acolor= #{acolor} j:#{@justify} dlL: #{@display_length} "

      prepare_default_colors focussed, selected

        value=value.to_s # ??
        #icon = object.is_leaf? ? "-" : "+"
        #icon = leaf ? "-" : "+"

        #level = treearraynode.level
        #node = treearraynode.node
        level = treearraynode.level
        node = treearraynode
        if parent.node_expanded? node
          icon = PLUS_MINUS  # can collapse
        else
          icon = PLUS_PLUS   # can expand
        end
        if node.children.size == 0
          icon = PLUS_Q # either no children or not visited yet
          if parent.has_been_expanded node
            icon = PLUS_MINUS # definitely no children, we've visited
          end
        end
        # adding 2 to level, that's the size of icon
        # XXX FIXME if we put the icon here, then when we scroll right, the icon will show, it shoud not
        # FIXME we ignore truncation etc on previous level and take the object as is !!!
        _value =  "%*s %s" % [ level+2, icon,  node.user_object ]
        @actual_length = _value.length
        pcol = @pcol
        if pcol > 0
          _len = @display_length || @parent.width-2
          _value = _value[@pcol..@pcol+_len-1] 
        end
        _value ||= ""
        if @height && @height > 1
        else
          # ensure we do not exceed
          if !@display_length.nil?
            if _value.length > @display_length
              @actual_length = _value.length
              _value = _value[0..@display_length-1]
            end
          end
          #lablist << value
        end
        len = @display_length || _value.length
        graphic.printstring r, c, "%-*s" % [len, _value], @color_pair,@attr
        #_height = @height || 1
        #0.upto(_height-1) { |i| 
          #graphic.printstring r+i, c, ( " " * len) , @color_pair,@attr
        #}
        #lablist.each_with_index do |_value, ix|
          #break if ix >= _height
          #if @justify.to_sym == :center
            #padding = (@display_length - _value.length)/2
            #_value = " "*padding + _value + " "*padding # so its cleared if we change it midway
          #end
          #graphic.printstring r, c, str % [len, _value], @color_pair,@attr
          #r += 1
        #end
    end
paint a list box cell
  2010-09-02 15:38 changed focussed to take true, false and :SOFT_FOCUS
  SOFT_FOCUS means the form focus is no longer on this field, but this row
  was focussed when use was last on this field. This row will take focus
  when field is focussed again

  @param [Buffer] window or buffer object used for printing
  @param [Integer] row
  @param [Integer] column
  @param [Integer] actual index into data, some lists may have actual data elsewhere and
                  display data separate. e.g. rfe_renderer (directory listing)
  @param [String] text to print in cell
  @param [Boolean, :SOFT_FOCUS] cell focussed, not focussed, cell focussed but field is not focussed
  @param [Boolean] cell selected or not
renderer.repaint @graphic, r+hh, c+@left_margin, crow, object, content, focus_type, selected, expanded, leaf