libui-ng
A portable GUI library for C
uiMenu Struct Reference

An application level menu bar. More...

#include <ui.h>

Public Member Functions

uiMenuItemuiMenuAppendItem (uiMenu *m, const char *name)
 Appends a generic menu item. More...
 
uiMenuItemuiMenuAppendCheckItem (uiMenu *m, const char *name)
 Appends a generic menu item with a checkbox. More...
 
uiMenuItemuiMenuAppendQuitItem (uiMenu *m)
 Appends a new Quit menu item. More...
 
uiMenuItemuiMenuAppendPreferencesItem (uiMenu *m)
 Appends a new Preferences menu item. More...
 
uiMenuItemuiMenuAppendAboutItem (uiMenu *m)
 Appends a new About menu item. More...
 
void uiMenuAppendSeparator (uiMenu *m)
 Appends a new separator. More...
 
uiMenuuiNewMenu (const char *name)
 Creates a new menu. More...
 

Detailed Description

An application level menu bar.

The various operating systems impose different requirements on the creation and placement of menu bar items, hence the abstraction of the items Quit, Preferences and About.

An exemplary, cross platform menu bar:

Member Function Documentation

◆ uiMenuAppendAboutItem()

uiMenuItem * uiMenuAppendAboutItem ( uiMenu m)

Appends a new About menu item.

Parameters
muiMenu instance.
Warning
Only one such menu item may exist per application.
Returns
A new uiMenuItem instance.

◆ uiMenuAppendCheckItem()

uiMenuItem * uiMenuAppendCheckItem ( uiMenu m,
const char *  name 
)

Appends a generic menu item with a checkbox.

Parameters
muiMenu instance.
nameMenu item text.
A NUL terminated UTF-8 string.
Data is copied internally. Ownership is not transferred.
Returns
A new uiMenuItem instance.

◆ uiMenuAppendItem()

uiMenuItem * uiMenuAppendItem ( uiMenu m,
const char *  name 
)

Appends a generic menu item.

Parameters
muiMenu instance.
nameMenu item text.
A NUL terminated UTF-8 string.
Data is copied internally. Ownership is not transferred.
Returns
A new uiMenuItem instance.

◆ uiMenuAppendPreferencesItem()

uiMenuItem * uiMenuAppendPreferencesItem ( uiMenu m)

Appends a new Preferences menu item.

Parameters
muiMenu instance.
Returns
A new uiMenuItem instance.
Warning
Only one such menu item may exist per application.

◆ uiMenuAppendQuitItem()

uiMenuItem * uiMenuAppendQuitItem ( uiMenu m)

Appends a new Quit menu item.

Parameters
muiMenu instance.
Returns
A new uiMenuItem instance.
Warning
Only one such menu item may exist per application.

◆ uiMenuAppendSeparator()

void uiMenuAppendSeparator ( uiMenu m)

Appends a new separator.

Parameters
muiMenu instance.

◆ uiNewMenu()

uiMenu * uiNewMenu ( const char *  name)

Creates a new menu.

Typical values are File, Edit, Help.

Parameters
nameMenu label.
A NUL terminated UTF-8 string.
Data is copied internally. Ownership is not transferred.
Returns
A new uiMenu instance.

The documentation for this struct was generated from the following file: