Macaw OS C reference

Function ui_listbox

#include <macawui.h>
int ui_listbox(
    const char *id,
    const char **items,
    int n,
    int *selected,
    int rows
);

Shows a list to pick from. It scrolls with the mouse wheel, and the up and down keys move through it.

Parameters

idconst char *
A name you choose, different for each list, so it remembers how far it's scrolled.
itemsconst char **
An array of n strings, the items from the top. A NULL one shows as empty.
nint
How many items there are.
selectedint *
The address of an int of yours: the picked item, counting from 0, or -1 for none.
rowsint
How many rows show at once. 0 means 5.

Returns int

1 in the frame an item is double-clicked, or Enter is pressed on it, 0 otherwise.

In Widgets, with ui_label, ui_heading, ui_separator, ui_button, ui_checkbox, ui_radio, ui_slider, ui_textbox, ui_textboxex, ui_dropdown, ui_tabs, ui_progress, ui_swatches, ui_image.