Add a menu entry whose name will be an auto indexed number.
481944
def enum(self, desc, func=None, args=None, krgs=None):
        """"""
        name = str(len(self.entries)+1)
        self.entries.append(MenuEntry(name, desc, func, args or [], krgs or {}))
310073
public void setEnterpriseNumber(int index, Number value)
   {
      set(selectField(AssignmentFieldLists.ENTERPRISE_NUMBER, index), value);
   }
951649
def append(self):
        """"""
        target_index = get_index_from_alias(self.alias_name)
        if not target_index:
            self.replace()
        else:
            self.index_all(target_index)
1003725
def auto_slug_after_insert(mapper, connection, target):
    """"""
    if target.slug is None:
        target.slug = "{name}{sep}{id}".format(
            name=target.entity_class.lower(), sep=target.SLUG_SEPARATOR, id=target.id
        )
29935
def _insert_options(self, menu):
        """"""
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _('Mount disc image'),
            self._icons.get_icon('losetup', Gtk.IconSize.MENU),
            run_bg(lambda _: self._losetup())
        ))
        menu.append(Gtk.SeparatorMenuItem())
        menu.append(self._menuitem(
            _("Enable automounting"),
            icon=None,
            onclick=lambda _: self._daemon.automounter.toggle_on(),
            checked=self._daemon.automounter.is_on(),
        ))
        menu.append(self._menuitem(
            _("Enable notifications"),
            icon=None,
            onclick=lambda _: self._daemon.notify.toggle(),
            checked=self._daemon.notify.active,
        ))
        # append menu item for closing the application
        if self._quit_action:
            menu.append(Gtk.SeparatorMenuItem())
            menu.append(self._menuitem(
                _('Quit'),
                self._icons.get_icon('quit', Gtk.IconSize.MENU),
                lambda _: self._quit_action()
            ))
66855
def init_menu():
    """"""
    # Register settings menu
    item = current_menu.submenu('settings.admin')
    item.register(
        "admin.index",
        # NOTE: Menu item text (icon replaced by a cogs icon).
        _('%(icon)s Administration', icon='<i class="fa fa-cogs fa-fw"></i>'),
        visible_when=_has_admin_access,
        order=100)
815195
def add_value(self, value, index_point):
        """"""
        if index_point not in self.index:
            self.values.append(value)
            self.index.append(index_point)
896400
public function add()
    {
        $this->request->allowMethod(['get', 'post']);

        $menu = $this->Menus->newEntity();
        if ($this->request->is('post') && !empty($this->request->data)) {
            $this->Menus->patchEntity($menu, $this->request->data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been created.', $this->request->data['name']));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('menu', $menu);
    }
1351916
private String lookupItemName(String itemName, String suffix, boolean autoAdd) {
        return lookupItemName(itemName + "." + suffix, autoAdd);
    }
364432
public function add()
    {
        $this->loadModel('Menu.Menus');
        $menu = $this->Menus->newEntity();

        if ($this->request->data()) {
            $data = $this->request->data();
            $data['handler'] = 'Menu';
            $menu = $this->Menus->patchEntity($menu, $data, [
                'fieldList' => [
                    'title',
                    'handler',
                    'description',
                    'settings',
                ],
            ]);

            if ($this->Menus->save($menu, ['atomic' => true])) {
                $this->Flash->success(__d('menu', 'Menu has been created, now you can start adding links!'));
                $this->redirect(['plugin' => 'Menu', 'controller' => 'links', 'action' => 'add', $menu->id]);
            } else {
                $this->Flash->danger(__d('menu', 'Menu could not be created, please check your information'));
            }
        }

        $this->title(__d('menu', 'Create New Menu'));
        $this->set('menu', $menu);
        $this->Breadcrumb
            ->push('/admin/menu/manage')
            ->push(__d('menu', 'Creating new menu'), '#');
    }
1177541
def _add_submenu(self, parent, data):
        """"""

        for item in data:
            obj = item[0]
            if obj == wx.Menu:
                try:
                    __, menuname, submenu, menu_id = item
                except ValueError:
                    __, menuname, submenu = item
                    menu_id = -1

                menu = obj()
                self._add_submenu(menu, submenu)

                if parent == self:
                    self.menubar.Append(menu, menuname)
                else:
                    parent.AppendMenu(menu_id, menuname, menu)

            elif obj == wx.MenuItem:
                try:
                    msgtype, shortcut, helptext, item_id = item[1]
                except ValueError:
                    msgtype, shortcut, helptext = item[1]
                    item_id = wx.NewId()

                try:
                    style = item[2]
                except IndexError:
                    style = wx.ITEM_NORMAL

                menuitem = obj(parent, item_id, shortcut, helptext, style)
                self.shortcut2menuitem[shortcut] = menuitem
                self.id2menuitem[item_id] = menuitem

                parent.AppendItem(menuitem)

                self.ids_msgs[item_id] = msgtype

                self.parent.Bind(wx.EVT_MENU, self.OnMenu, id=item_id)

            elif obj == "Separator":
                parent.AppendSeparator()

            else:
                raise TypeError(_("Menu item unknown"))
57107
def insert(self, index, item):
        """"""
        super(ObservableList, self).insert(index, item)
        length = len(self)
        if index >= length:
            index = length - 1
        elif index < 0:
            index += length - 1
            if index < 0:
                index = 0
        self._notify_add_at(index)
280797
private MenuItem addInternal(int group, int id, int categoryOrder, CharSequence title) {
        final int ordering = getOrdering(categoryOrder);

        final MenuItemImpl item = new MenuItemImpl(this, group, id, categoryOrder,
                ordering, title, mDefaultShowAsAction);

        if (mCurrentMenuInfo != null) {
            // Pass along the current menu info
            item.setMenuInfo(mCurrentMenuInfo);
        }

        mItems.add(findInsertIndex(mItems, ordering), item);
        onItemsChanged(true);

        return item;
    }
1335489
def insert(self, i, tab_index):
        """"""
        _id = id(self.editor.tabs.widget(tab_index))
        self.history.insert(i, _id)
1074986
public function index(): void
    {
        $menus = $this->Menus->find('all');

        $this->set(compact('menus'));
        $this->set('_serialize', ['navMenu']);
    }
430205
def _append(self, menu):
        ''''''
        from wx_loader import wx

        menu.AppendMenu(-1, self.name, self.wx_menu())
276883
def on_add(self, item):
        """"""
        super(Tels, self).on_add(list_views.PseudoAccesCategorie(item))