Adafruit-GFX-Library
Adafruit-GFX-Library copied to clipboard
Method needed for updating button label
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.