finite_button_delete
The finite_button_delete function removes a FiniteBtn from a FiniteShell, freeing its memory and maintaining the integrity of the FiniteShell.btns array.
void finite_button_delete(FiniteShell *shell, int id);Parameters
Section titled “Parameters”| Type | Description |
|---|---|
FiniteShell *shell | The shell containing the button to delete. |
int id | The id of the button to delete in the shell’s button array. |
Code Example
Section titled “Code Example”FiniteBtn *btn = finite_button_create(shell, select_cb, NULL, NULL, NULL);FiniteBtn *btn2 = finite_button_create(shell, select_cb, NULL, NULL, NULL);
finite_button_delete(shell, 1);Standard Usage
Section titled “Standard Usage”The shell must be valid and contain the button to delete.
id must be within the range of existing buttons (0 to shell->_btns - 1).
After deletion, all buttons after the removed one are shifted to maintain contiguous indexing.