Multi-state button source code example