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 (...)

Represents an option within a Menu. They will always have an associated action that will be executed when activated.

❮ Back
Next ❯

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 gui_state_t state);
item

The item.

state

State.

❮ Back
Next ❯