TopBarMenu

TopBarNew

Create a main menu bar on a terminal row

Syntax

Signature
TopBarMenu *TopBarNew( int row, int left, int right );

Arguments

row the screen row. NIL is invalid.

left the first screen column. NIL is invalid.

right the last screen column, inclusive. NIL is invalid.

Return value

The new TopBarMenu object, or NULL when row, left or right is NIL. Release it with TopBarFree().

Description

Include xdev-wtui-classes.h. Use a `TopBarMenu` as the main menu and attach options with `TopBarAddItem()`. Create a `MenuItem` with `MenuItemNewO()` to open a `PopUpMenu` or with `MenuItemNewB()` to run a C callback.

The menu starts empty with current position `0` and takes its default colors from `SetColor()`. Use `TopBarDisplay()` to draw it. `MenuModal()` handles keyboard and mouse interaction, and `ReadModal()` can use the bar as the menu of a READ.

The C constructor returns `NULL` for a missing coordinate to report failure through its pointer result. Operations such as appending and selecting an item return `T` or `F` so the caller can check success directly. The corresponding xBase methods return the object.

See also