| PopupNew | Function (ROM Call 0x45)

menus.h

HANDLE PopupNew (const char *Title, short Height);

Creates a new popup menu.

PopupNew allocates memory for a new popup menu, initializes the allocated block with the necessary structures and returns a handle to it (or H_NULL in case of an error). You can later free the memory by calling HeapFree. Title is the title of the menu (you can pass NULL if you do not want a title), and Height is the height of the menu box in pixels (you can pass 0 for autocalculating the height). If the cumulated height of the items in the menu is greater than the available height of the menu box, the contents of the menu will scroll up or down if necessary.
This empty popup structure can be modified with PopupAddText (or DynMenuAdd and DynMenuChange if you wish to use program only on AMS 2.00 or later). The popup can then be executed with PopupDo (or PopupBegin and PopupBeginDo on AMS 2.00 or later if specific menu features are needed).
Note: If Title is longer than 18 characters, it will be truncated by storing a zero byte into the string after the 18th character. You have to be especially careful because the Title parameter is not constant in this case.

Uses: HeapAlloc, memset, strlen, strncpy
Used by: VarCreateFolderPopup, cmd_dialog, cmd_popup, VarNew, VarOpen, VarSaveAs, EV_defaultHandler, MO_modeDialog, HomeExecute, EV_quit, ROM Call 0x3F7, ROM Call 0x3F8, ROM Call 0x486

See also: PopupDo, PopupBegin, PopupClear, DynMenuAdd, DynMenuChange, PopupAddText