1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
# area/fullscreen

```go
package main
import (
"time"
"github.com/pterm/pterm"
)
func main() {
// Start a new fullscreen area. This will return an area instance and an error.
// The underscore (_) is used to ignore the error.
area, _ := pterm.DefaultArea.WithFullscreen().Start()
// Loop 5 times to update the area content.
for i := 0; i < 5; i++ {
// Update the content of the area with the current count.
// The Sprintf function is used to format the string.
area.Update(pterm.Sprintf("Current count: %d\nAreas can update their content dynamically!", i))
// Pause for a second before the next update.
time.Sleep(time.Second)
}
// Stop the area after all updates are done.
area.Stop()
}
```
|