code: func newMenuItem(parentCtx context.Context, rootID string, o *MenuItemOptions, c *asticontext.Canceller, d *dispatcher, i *identifier, w *writer) (m *MenuItem) {
  	m = &MenuItem{
  		o:      o,
  		object: newObject(parentCtx, c, d, i, w, i.new()),
  		rootID: rootID,
  	}
  	if o.OnClick != nil {
  		m.On(EventNameMenuItemEventClicked, o.OnClick)
  	}
  	if len(o.SubMenu) > 0 {
  		m.s = &SubMenu{newSubMenu(parentCtx, rootID, o.SubMenu, c, d, i, w)}
  	}
  	return
  }
docs: // newMenu creates a new menu item