Chapter 3
Interact with the Grid
Section 5
Handle Button Clicks
The grid is in place, and we can add live cells to the game; now it's time to get the buttons set up. We'll begin by getting the button handlers in place, and the initial button states working. Then, in later lessons, we'll start filling in the game play. Before we dive into the button handler code though, prepare by making sure you know exactly how the buttons are going to work. The buttons give us a way of controlling the flow of the Game of Life—we can start the game, stop it, or continue computing new generations. We can also wipe the grid clear and start over. This lesson's video takes you through the functionality of the buttons in detail so you'll be ready to implement the code.