def repaint
      return if !@visible
      return unless @repaint_required
      @repaint_required = false
      @color_pair = get_color($reversecolor, @color, @bgcolor)
      @window ||= create_window_menubar
      #@window.printstring( 0, 0, "%-*s" % [@cols," "], @color_pair) # this becomes blank in some terms
      c = 1; r = 0;
      @items.each do |item|
        item.row = r; item.col = c; item.coffset = c; item.parent = self
        item.color = @color
        item.bgcolor = @bgcolor
        @window.printstring( r, c, " %s " % item.text, @color_pair)
        # 2011-09-26 V1.3.1 quick dirty highlighting of first menu on menubar
        # on opening since calling highlight was giving bug in parent.width
        #if c == 1
          #att =  Ncurses::A_REVERSE
          #@window.mvchgat(y=r, x=c+1, item.text.length+1, att, @color_pair, nil)
        #end
        c += (item.text.length + 2)
      end
      #@items[0].on_enter # 2011-09-25 V1.3.1  caused issues when toggling, first item fired on DOWN
      @items[0].highlight unless @keep_visible # 2011-09-26 V1.3.1   fixed to take both cases into account
      @window.wrefresh
    end
def repaint
      return if !@visible
      return unless @repaint_required
      @repaint_required = false
      @color_pair = get_color($reversecolor, @color, @bgcolor)
      @window ||= create_window_menubar
      #@window.printstring( 0, 0, "%-*s" % [@cols," "], @color_pair) # this becomes blank in some terms
      c = 1; r = 0;
      @items.each do |item|
        item.row = r; item.col = c; item.coffset = c; item.parent = self
        item.color = @color
        item.bgcolor = @bgcolor
        @window.printstring( r, c, " %s " % item.text, @color_pair)
        # 2011-09-26 V1.3.1 quick dirty highlighting of first menu on menubar
        # on opening since calling highlight was giving bug in parent.width
        #if c == 1
          #att =  Ncurses::A_REVERSE
          #@window.mvchgat(y=r, x=c+1, item.text.length+1, att, @color_pair, nil)
        #end
        c += (item.text.length + 2)
      end
      #@items[0].on_enter # 2011-09-25 V1.3.1  caused issues when toggling, first item fired on DOWN
      @items[0].highlight unless @keep_visible # 2011-09-26 V1.3.1   fixed to take both cases into account
      @window.wrefresh
    end
menubar
 TODO: check for menu to be flush right (only for last one).
 TODO: repaint only if needed