Skip to content

finite_button_create_relation

The finite_button_create_relation function establishes a directional navigation relationship between buttons in a FiniteShell.

void finite_button_create_relation(
FiniteShell *shell,
FiniteBtn *btn,
FiniteDirectionType dir,
int relation
);
TypeDescription
FiniteShell *shellThe shell containing the buttons.
FiniteBtn *btnThe button for which the relationship will be created.
FiniteDirectionType dirThe directional relationship to establish (e.g., FINITE_DIRECTION_UP).
int relationThe id of the button that btn should relate to in the given direction.
void select_cb(FiniteBtn *self, int id, void *data) {
FINITE_LOG("Button %d selected!\n", id);
}
FiniteBtn *btn = finite_button_create(shell, select_cb, NULL, NULL, NULL);
FiniteBtn *btn2 = finite_button_create(shell, select_cb, NULL, NULL, NULL);
finite_button_create_relation(shell, btn, FINITE_DIRECTION_UP, btn2.id);

FiniteBtn must already exist in FiniteShell.btns.

relation must be a valid button id within the shell.