Never ever write a buffer overflowable function without an EXTREME performance need.  AddButton doesn't qualify.
Umm, make 'all' the default target again, not 'doc'
Make an OUT_OF_ROOM fail code.  Use for AddButton.  Consider for ElementTable::Insert