original_docstring: Adds a menu item and sorts it vertically with others
docstring: Adds a menu item and sorts it vertically with others
docstring_tokens: Adds a menu item and sorts it vertically with others
code: def add_item(self, text='', command=None, selected=False):
          """Adds a menu item and sorts it vertically with others"""
          item = MenuItem(self, self.screen, self.color, self.pos.copy(),
                          self.size, text=text, highlight_color=self.highlight_color, command=command, selected=selected)
  
          item.pos[1] = self.pos[1] + (item.size[1] * (len(self.children) + 1))
          item.parent = self
          self.children.append(item)
          self.parent.children.append(item)
          self.parent.resize_width()
          return item
code_tokens: def add_item ( self , text = '' , command = None , selected = False ) : item = MenuItem ( self , self . screen , self . color , self . pos . copy ( ) , self . size , text = text , highlight_color = self . highlight_color , command = command , selected = selected ) item . pos [ 1 ] = self . pos [ 1 ] + ( item . size [ 1 ] * ( len ( self . children ) + 1 ) ) item . parent = self self . children . append ( item ) self . parent . children . append ( item ) self . parent . resize_width ( ) return item
short_docstring: Adds a menu item and sorts it vertically with others
short_docstring_tokens: Adds a menu item and sorts it vertically with others
comment: """Adds a menu item and sorts it vertically with others"""