parameters: (self, menudefs=None, keydefs=None)
docstring: Add appropriate entries to the menus and submenus
  
          Menus that are absent or None in self.menudict are ignored.
docstring_summary: Add appropriate entries to the menus and submenus
docstring_tokens: Add appropriate entries to the menus and submenus
function: def fill_menus(self, menudefs=None, keydefs=None):
          """Add appropriate entries to the menus and submenus
  
          Menus that are absent or None in self.menudict are ignored.
          """
          if menudefs is None:
              menudefs = self.mainmenu.menudefs
          if keydefs is None:
              keydefs = self.mainmenu.default_keydefs
          menudict = self.menudict
          text = self.text
          for mname, entrylist in menudefs:
              menu = menudict.get(mname)
              if not menu:
                  continue
              for entry in entrylist:
                  if not entry:
                      menu.add_separator()
                  else:
                      label, eventname = entry
                      checkbutton = (label[:1] == '!')
                      if checkbutton:
                          label = label[1:]
                      underline, label = prepstr(label)
                      accelerator = get_accelerator(keydefs, eventname)
                      def command(text=text, eventname=eventname):
                          text.event_generate(eventname)
                      if checkbutton:
                          var = self.get_var_obj(eventname, BooleanVar)
                          menu.add_checkbutton(label=label, underline=underline,
                              command=command, accelerator=accelerator,
                              variable=var)
                      else:
                          menu.add_command(label=label, underline=underline,
                                           command=command,
                                           accelerator=accelerator)
function_tokens: def fill_menus ( self , menudefs = None , keydefs = None ) : if menudefs is None : menudefs = self . mainmenu . menudefs if keydefs is None : keydefs = self . mainmenu . default_keydefs menudict = self . menudict text = self . text for mname , entrylist in menudefs : menu = menudict . get ( mname ) if not menu : continue for entry in entrylist : if not entry : menu . add_separator ( ) else : label , eventname = entry checkbutton = ( label [ : 1 ] == '!' ) if checkbutton : label = label [ 1 : ] underline , label = prepstr ( label ) accelerator = get_accelerator ( keydefs , eventname ) def command ( text = text , eventname = eventname ) : text . event_generate ( eventname ) if checkbutton : var = self . get_var_obj ( eventname , BooleanVar ) menu . add_checkbutton ( label = label , underline = underline , command = command , accelerator = accelerator , variable = var ) else : menu . add_command ( label = label , underline = underline , command = command , accelerator = accelerator )