# Changing the screen

There are two ways to change a container from code:

- **A dot for one change:** `score_label.color = red`.
- **A block for several:** the container's name, then the new attributes underneath.

```vi
main home:
  arrange: center
  space_between: 16
  children:
    light
    switch

light:
  size: 40
  shape: circle
  color: gray[300]
  animate: 0.4 seconds

switch:
  button: "Turn on for 2 seconds"
  on_tap: blink()

blink():
  light:
    color: amber[400]
    shadow: true
  switch.text = "On…"
  wait(2 seconds)
  light:
    color: gray[300]
    shadow: false
  switch.text = "Turn on for 2 seconds"
```

- `light` and `switch` are top-level containers, so `blink()` reaches them by name (lesson
  **Reaching other containers**).
- `wait(2 seconds)` pauses the function; the rest of the app keeps running.
- `animate: 0.4` makes changes to size, place, colour, `see_through`, `flip` and `tilt` glide over
  0.4 seconds instead of jumping.
- Changing a variable that a container uses redraws it too: often that is all you need.
