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

A menu item used in conjunction with uiMenu. More...

#include <ui.h>

Public Member Functions

void uiMenuItemEnable (uiMenuItem *m)
 Enables the menu item. More...
 
void uiMenuItemDisable (uiMenuItem *m)
 Disables the menu item. More...
 
void uiMenuItemOnClicked (uiMenuItem *m, void(*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data)
 Registers a callback for when the menu item is clicked. More...
 
int uiMenuItemChecked (uiMenuItem *m)
 Returns whether or not the menu item's checkbox is checked. More...
 
void uiMenuItemSetChecked (uiMenuItem *m, int checked)
 Sets whether or not the menu item's checkbox is checked. More...
 

Detailed Description

A menu item used in conjunction with uiMenu.

Member Function Documentation

◆ uiMenuItemChecked()

int uiMenuItemChecked ( uiMenuItem m)

Returns whether or not the menu item's checkbox is checked.

To be used only with items created via uiMenuAppendCheckItem().

Parameters
muiMenuItem instance.
Returns
TRUE if checked, FALSE otherwise. [Default: FALSE]

◆ uiMenuItemDisable()

void uiMenuItemDisable ( uiMenuItem m)

Disables the menu item.

Menu item is grayed out and user interaction is not possible.

Parameters
muiMenuItem instance.

◆ uiMenuItemEnable()

void uiMenuItemEnable ( uiMenuItem m)

Enables the menu item.

Parameters
muiMenuItem instance.

◆ uiMenuItemOnClicked()

void uiMenuItemOnClicked ( uiMenuItem m,
void(*)(uiMenuItem *sender, uiWindow *window, void *senderData)  f,
void *  data 
)

Registers a callback for when the menu item is clicked.

Parameters
muiMenuItem instance.
fCallback function.
sender Back reference to the instance that triggered the callback.
window Reference to the window from which the callback got triggered.\ senderData User data registered with the sender instance.
dataUser data to be passed to the callback.
Note
Only one callback can be registered at a time.

◆ uiMenuItemSetChecked()

void uiMenuItemSetChecked ( uiMenuItem m,
int  checked 
)

Sets whether or not the menu item's checkbox is checked.

To be used only with items created via uiMenuAppendCheckItem().

Parameters
muiMenuItem instance.
checkedTRUE to check menu item checkbox, FALSE otherwise.

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