def repaint # stackflow
      my_win = @form ? @form.window : @target_window
      @graphic = my_win unless @graphic
      raise " #{@name} NO GRAPHIC set as yet                 STACKFLOW paint " unless @graphic
      # actually at this level we don't have margins set -- not yet.
      @margin_left   ||= 0
      @margin_right  ||= 0
      @margin_top    ||= 0
      @margin_bottom ||= 0
      r  = @row + @row_offset + @margin_top
      c  = @col + @col_offset + @margin_left
      ht = @height-2-(@margin_top + @margin_bottom)
      wd = @width -2-(@margin_left + @margin_right)
      # should this not happen only if repaint_required ?
      @components.each { |e| 
        e.parent_component = self
        e.row              = r
        e.col              = c
        # check that we are not trying to print outside bounds
        # by default we are stacking top level comps regardless of stack or flow
        #  otherwise too complicated
        if e.is_a? BaseStack 
          # using ||= allows us to use overrides given by user
          # but disallows us from calculating if size changes
            e.height           = (ht) * (e.weight * 0.01)
            e.height           = e.height.round 
            e.width            = wd 
            if e.row + e.height >= @row + @height
              #alert "is exceeding #{e.row} #{e.height} > #{@row} + #{@height} "
              e.height = @height - e.row - 1
            end
            r += e.height
            $log.debug "XXX: STACK r:#{e.row} e.h: #{e.height} w:#{e.weight} h: #{@height} "
          #if e.type == :flow
            #e.height           ||= (@height-2) * (e.weight * 0.01)
            #e.height           = e.height.round
            #e.width            ||= (@width-2) 
            #r += e.height
          #elsif e.type == :stack
            #e.width            ||= (@width-2) * (e.weight * 0.01)
            #e.width            = e.width.round
            #e.height           ||= (@height-2)
            #c += e.width
          #end
        end
        check_coords e
        attach_form e unless e.form
      } # seeme one if printing out
      last = @components.last
      if last.row + last.height < @row + @height
        last.height += 1 # @row + @height - last.row + last.height
      end

      # if some major change has happened then repaint everything
      # if multiple components then last row and col needs to be stored or else overlap will happen FIXME
      if @repaint_required
        $log.debug " STACKFLOW repaint graphic #{@graphic}, size:#{@components.size} "
        print_borders unless @suppress_borders # do this once only, unless everything changes
        @components.each { |e| e.repaint_all(true); e.repaint }
      else
        @components.each { |e| e.repaint }
      end # if repaint_required

      @repaint_required = false
    end
def repaint # stackflow
      my_win = @form ? @form.window : @target_window
      @graphic = my_win unless @graphic
      raise " #{@name} NO GRAPHIC set as yet                 STACKFLOW paint " unless @graphic
      # actually at this level we don't have margins set -- not yet.
      @margin_left   ||= 0
      @margin_right  ||= 0
      @margin_top    ||= 0
      @margin_bottom ||= 0
      r  = @row + @row_offset + @margin_top
      c  = @col + @col_offset + @margin_left
      ht = @height-2-(@margin_top + @margin_bottom)
      wd = @width -2-(@margin_left + @margin_right)
      # should this not happen only if repaint_required ?
      @components.each { |e| 
        e.parent_component = self
        e.row              = r
        e.col              = c
        # check that we are not trying to print outside bounds
        # by default we are stacking top level comps regardless of stack or flow
        #  otherwise too complicated
        if e.is_a? BaseStack 
          # using ||= allows us to use overrides given by user
          # but disallows us from calculating if size changes
            e.height           = (ht) * (e.weight * 0.01)
            e.height           = e.height.round 
            e.width            = wd 
            if e.row + e.height >= @row + @height
              #alert "is exceeding #{e.row} #{e.height} > #{@row} + #{@height} "
              e.height = @height - e.row - 1
            end
            r += e.height
            $log.debug "XXX: STACK r:#{e.row} e.h: #{e.height} w:#{e.weight} h: #{@height} "
          #if e.type == :flow
            #e.height           ||= (@height-2) * (e.weight * 0.01)
            #e.height           = e.height.round
            #e.width            ||= (@width-2) 
            #r += e.height
          #elsif e.type == :stack
            #e.width            ||= (@width-2) * (e.weight * 0.01)
            #e.width            = e.width.round
            #e.height           ||= (@height-2)
            #c += e.width
          #end
        end
        check_coords e
        attach_form e unless e.form
      } # seeme one if printing out
      last = @components.last
      if last.row + last.height < @row + @height
        last.height += 1 # @row + @height - last.row + last.height
      end

      # if some major change has happened then repaint everything
      # if multiple components then last row and col needs to be stored or else overlap will happen FIXME
      if @repaint_required
        $log.debug " STACKFLOW repaint graphic #{@graphic}, size:#{@components.size} "
        print_borders unless @suppress_borders # do this once only, unless everything changes
        @components.each { |e| e.repaint_all(true); e.repaint }
      else
        @components.each { |e| e.repaint }
      end # if repaint_required

      @repaint_required = false
    end
what of by_name
 repaint object
 called by Form, and sometimes parent component (if not form).