ActionTreeNode InsertAction(int pos) { using (wrapper.UndoManager.AtomicChange) { Wrapper.Action ac = (Wrapper.Action)ObjectWrapper.Create(wrapper.Project, new Gtk.Action("", "", null, null)); ActionTreeNode newNode = new ActionTreeNode(Gtk.UIManagerItemType.Menuitem, null, ac); nodes.Insert(pos, newNode); ActionMenuItem item = FindMenuItem(newNode); item.EditingDone += OnEditingDone; item.Select(); item.StartEditing(); emptyLabel.Hide(); if (wrapper.LocalActionGroups.Count == 0) { wrapper.LocalActionGroups.Add(new ActionGroup("Default")); } wrapper.LocalActionGroups [0].Actions.Add(ac); return(newNode); } }