### clickable buttons
There's a facility for rendering buttons and responding to events when they're
clicked. It requires setting up 3 things:
- a `state` table housing all buttons. Can be the same `state` variable the
text-editor widget uses, but doesn't have to be.
- specifying buttons to create in `state`. This must happen either directly
or indirectly within `App.draw`.
- responding to clicks on buttons in `state`. This must happen either
directly or indirectly within `App.mousepressed`.
The following facilities help set these things up:
* Clear `state` at the start of each frame:
```
state.button_handlers = {}
```
Don't forget to do this, or your app will get slower over time.
* `button` creates a single button. The syntax is:
```
button(state, name, {x=..., y=..., w=..., h=..., color={r,g,b},
icon = function({x=..., y=..., w=..., h=...}) ... end,
onpress1 = ...
})
```
Call this either directly or indirectly from `App.draw`. It will paint a
rectangle to the screen with top-left at (x,y), dimensions w×h pixels in the
specified `color`. It will then overlay any drawing instructions within
`icon` atop it. The `icon` callback will receive a table containing the same
x/y/w/h.