Cross-platform C SDK logo

Cross-platform C SDK

MenuItem

❮ Back
Next ❯
This page has been automatically translated using the Google Translate API services. We are working on improving texts. Thank you for your understanding and patience.

Functions

MenuItem*menuitem_create (void)
MenuItem*menuitem_separator (void)
voidmenuitem_OnClick (...)
voidmenuitem_enabled (...)
voidmenuitem_visible (...)
voidmenuitem_text (...)
voidmenuitem_image (...)
voidmenuitem_key (...)
voidmenuitem_submenu (...)
voidmenuitem_state (...)

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


menuitem_create ()

Create a new item for a menu.

MenuItem*
menuitem_create(void);

Return

The newly item.


menuitem_separator ()

Create a new separator for a menu.

MenuItem*
menuitem_separator(void);

Return

The newly item.


menuitem_OnClick ()

Set an event handle for item click.

void
menuitem_OnClick(MenuItem *item,
                 Listener *listener);
item

The item.

listener

Callback function to be called after clicking.

Remarks

See GUI Events.


menuitem_enabled ()

Enables or disables a menu item.

void
menuitem_enabled(MenuItem *item,
                 const bool_t enabled);
item

The item.

enabled

Enabled or not.


menuitem_visible ()

Show or hide a menu item.

void
menuitem_visible(MenuItem *item,
                 const bool_t enabled);
item

The item.

enabled

Enabled or not.


menuitem_text ()

Set the item text.

void
menuitem_text(MenuItem *item,
              const char_t *text);
item

The item.

text

UTF8 C-string terminated in null character '\0'.


menuitem_image ()

Set the icon that will display the item.

void
menuitem_image(MenuItem *item,
               const Image *image);
item

The item.

image

Image.


menuitem_key ()

Set a keyboard shortcut to select the menu item.

void
menuitem_key(MenuItem *item,
             const vkey_t key,
             const uint32_t modifiers);
item

The item.

key

Key code.

modifiers

Modifiers.


menuitem_submenu ()

Assign a drop-down submenu when selecting the item.

void
menuitem_submenu(MenuItem *item,
                 Menu **submenu);
item

The item.

submenu

The submenu.


menuitem_state ()

Set the status of the item, which will be reflected with a mark next to the text.

void
menuitem_state(MenuItem *item,
               const state_t state);
item

The item.

state

State.

❮ Back
Next ❯