Name
SetMenuBar -- set display's menu bar (V9.0)
Synopsis
int ok = SetMenuBar(APTR display, struct hwMenuTreeInfo *menu,
             struct hwTagList *tags);
Function
This function is optional and must only be implemented if the HWEXT_DISPLAYADAPTER_MENUADAPTER extension bit has been set. See Extension plugins for details. If that is the case, SetMenuBar() must set the display's menu bar to the one specified in the menu parameter. The menu parameter will be either a pointer to a struct hwMenuTreeInfo describing the menu tree or NULL. If it is NULL, the menu bar must be removed from the display.

struct hwMenuTreeInfo looks like this:

 
struct hwMenuTreeInfo
{
    struct hwMenuTreeInfo *Succ;
    STRPTR Name;
    STRPTR ID;
    STRPTR Hotkey;
    ULONG Flags;
    struct hwMenuTreeInfo *FirstChild;
    APTR UserData;
};

Here is a description of the individual structure members:

Succ:
Will be set to a pointer to the next tree node or NULL if this node is the last one.

Name:
Null-terminated string containing the menu item's title. If this is NULL, you must create a separator item.

ID:
Null-terminated string containing the menu item's identifier or NULL.

Hotkey:
Null-terminated string containing the menu item's shortcut or NULL.

Flags:
A combination of the following flags:

HWMENUFLAGS_TOGGLE:
The menu item shall be a toggle menu.

HWMENUFLAGS_RADIO:
The menu item shall be part of a radio group.

HWMENUFLAGS_SELECTED:
The menu item shall be initially selected. This can only be set if either HWMENUFLAGS_TOGGLE or HWMENUFLAGS_RADIO is set.

HWMENUFLAGS_DISABLED:
The menu item shall be initially disabled.

FirstChild:
Pointer to the menu tree of the subitem. If it is NULL, the menu item doesn't have a subitem.

UserData:
You may store user data here. This can be useful to refer to this item when Hollywood calls your SetMenuAttributes() or GetMenuAttributes() functions.

Whenever the user selects a menu item, you need to post an HWEVT_MENUITEM event to Hollywood's event queue. See hw_PostEvent for details.

Inputs
handle
display handle returned by OpenDisplay()
menu
menu tree definition or NULL to remove menu
tags
reserved for future use, currently always NULL
Results
ok
return True to indicate success, False to indicate failure

Show TOC