You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: