// AddToSubMenu adds a slice of MenuOptions to this option
505483
func (c *MenuOption) AddToSubMenu(sub *MenuOption) {
	c.subMenu = append(c.subMenu, *sub)
}
164760
func (t *Tray) NewMenu(i []*MenuItemOptions) *Menu {
	return newMenu(t.ctx, t.id, i, t.c, t.d, t.i, t.w)
}
861596
func (c Client) AddSubscription(s contract.Subscription) (string, error) {
	conn := c.Pool.Get()
	defer conn.Close()

	err := addSubscription(conn, &s)
	if err != nil {
		return "", err
	}

	return s.ID, nil
}
193902
func (s *Section) AddOption(key string, value string) *Section {
	s.Options = s.Options.withAddedOption(key, value)
	return s
}
331344
func (ev *ExternalVolume) AddOption(name, value string) *ExternalVolume {
	if ev.Options == nil {
		ev.EmptyOptions()
	}
	(*ev.Options)[name] = value

	return ev
}
1199726
func (ps *PubSub) AddSub(ch chan interface{}, topics ...string) {
	ps.cmdChan <- cmd{op: sub, topics: topics, ch: ch}
}
777536
func CreateDropMenu(title string, options []string, x, y, width, height int, fg, bg, cursorFg, cursorBg termbox.Attribute) *DropMenu {
	c := DropMenu{
		title: title,
		x:     x, y: y, width: width, height: height,
		fg: fg, bg: bg, activeFg: fg, activeBg: bg,
		cursorFg: fg, cursorBg: bg,
	}
	c.menu = CreateMenu("", options, x, y+2, width, height, fg, bg)
	return &c
}
2547
func addOptions(s string, opt interface{}) (string, error) {
	v := reflect.ValueOf(opt)
	if v.Kind() == reflect.Ptr && v.IsNil() {
		return s, nil
	}

	u, err := url.Parse(s)
	if err != nil {
		return s, err
	}

	qs, err := query.Values(opt)
	if err != nil {
		return s, err
	}

	u.RawQuery = qs.Encode()
	return u.String(), nil
}
890061
func (c *Menu) SetOptionEnabled(idx int) {
	if len(c.options) > idx {
		c.GetOptionFromIndex(idx).Enable()
	}
}
264468
func UpgradeSubNotes(enable bool) UpdateOption {
	return func(opts *options) {
		opts.updateReq.SubNotes = enable
	}
}
500423
func (p *parser) pushOptions() {
	p.optionsStack = append(p.optionsStack, p.options)
}
556390
func NewMenu() *Menu {
	menu := Menu{}
	menuCreate := Command{
		Action:     "create",
		ObjectType: "menu",
	}
	menu.Sync = MenuSync{
		ReadyChan:        make(chan bool),
		DisplayedChan:    make(chan bool),
		ChildStableChan:  make(chan uint),
		TreeStableChan:   make(chan bool),
		ReadyQueue:       make([]*Command, 0),
		DisplayedQueue:   make([]*Command, 0),
		ChildStableQueue: make([]*ChildCommand, 0),
		TreeStableQueue:  make([]*Command, 0),
	}
	menu.ReplyHandlers = make(map[uint]func(reply CommandResponse, item *MenuItem))
	menu.SetSendChannel(connection.GetInputChannels())
	menu.WaitingResponses = append(menu.WaitingResponses, &menuCreate)
	dispatcher.RegisterHandler(menu.DispatchResponse)

	go menu.SendThread()
	menu.Send(&menuCreate)

	return &menu
}
751229
func (a *Astilectron) NewMenu(i []*MenuItemOptions) *Menu {
	return newMenu(nil, targetIDApp, i, a.canceller, a.dispatcher, a.identifier, a.writer)
}
39444
func newMenu(parentCtx context.Context, rootID string, items []*MenuItemOptions, c *asticontext.Canceller, d *dispatcher, i *identifier, w *writer) (m *Menu) {
	// Init
	m = &Menu{newSubMenu(parentCtx, rootID, items, c, d, i, w)}

	// Make sure the menu's context is cancelled once the destroyed event is received
	m.On(EventNameMenuEventDestroyed, func(e Event) (deleteListener bool) {
		m.cancel()
		return true
	})
	return
}
1039972
func (b *Builder) AddSubprogram(fnname string, lowpc, highpc uint64) dwarf.Offset {
	r := b.TagOpen(dwarf.TagSubprogram, fnname)
	b.Attr(dwarf.AttrLowpc, Address(lowpc))
	b.Attr(dwarf.AttrHighpc, Address(highpc))
	return r
}
627557
func (m *subMenu) SubMenu(indexes ...int) (s *SubMenu, err error) {
	var is = m
	var processedIndexes = []string{}
	for _, index := range indexes {
		if index >= len(is.items) {
			return nil, fmt.Errorf("Submenu at %s has %d items, invalid index %d", strings.Join(processedIndexes, ":"), len(is.items), index)
		}
		s = is.items[index].s
		processedIndexes = append(processedIndexes, strconv.Itoa(index))
		if s == nil {
			return nil, fmt.Errorf("No submenu at %s", strings.Join(processedIndexes, ":"))
		}
		is = s.subMenu
	}
	return
}
897535
func (m *subMenu) Popup(o *MenuPopupOptions) error {
	return m.PopupInWindow(nil, o)
}