Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Method needed for updating button label #421

Open
Anacapala opened this issue Mar 25, 2023 · 0 comments
Open

Method needed for updating button label #421

Anacapala opened this issue Mar 25, 2023 · 0 comments

Comments

@Anacapala
Copy link

A method is needed to update a button label without re-initializing the button. The following should be added.

/**************************************************************************/
void Adafruit_GFX_Button::setLabel(const char *label) {
strncpy(_label, label, 9);
_label[9] = 0; // strncpy does not place a null at the end.
// When 'label' is >9 characters, _label is not terminated.
}
// -------------------------------------------------------------------------

A drawButton() could be included but is probably not required as the most likely usage is to update the button immediately before redrawing in user code for a change of state.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant