AddToTopMenu Function

Adds an topobj to a TopMenu.

TopMenuObject AddToTopMenu(Handle topmenu, const char[] name, TopMenuObjectType type, TopMenuHandler handler, TopMenuObject parent, const char[] cmdname, int flags, const char[] info_string)

Parameters

Handle topmenu

TopMenu Handle.

const char[] name

Object name (MUST be unique).

TopMenuObjectType type

Object type.

TopMenuHandler handler

Handler for topobj.

TopMenuObject parent

Parent topobj ID, or INVALID_TOPMENUOBJECT for none. Items must have a category parent. Categories must not have a parent.

const char[] cmdname

Command name (for access overrides).

int flags

Default access flags.

const char[] info_string

Arbitrary storage (max 255 bytes).

Return Value

A new TopMenuObject ID, or INVALID_TOPMENUOBJECT on failure.

Errors

Invalid TopMenu Handle.