Example #1
0
func (m *Menu) AppendPopup(t string) *Menu {
	menu := NewMenu()
	mi := new(MenuItem)
	mi.Text = t
	mi.id = uintptr(menu.handle)
	mi.Submenu = menu
	w32.AppendMenu(m.handle, w32.MF_STRING|w32.MF_POPUP, mi.id, t)
	return menu
}
Example #2
0
func (m *Menu) AppendItemText(t string) *MenuItem {
	mi := new(MenuItem)
	mi.Text = t
	mi.id = uintptr(miCount)
	miCount++
	if w32.AppendMenu(m.handle, w32.MF_STRING, mi.id, t) {
		menuItems = append(menuItems, mi)
		m.Items = append(m.Items, mi)
	}
	return mi
}