Edit me

Data binding was introduced in Fyne v2.0.0 and makes it easier to connect many widgets to a data source that will update over time. the data/binding package has many helpful bindings that can manage most standard types that will be used in an application. A data binding can be managed using the binding API (for example NewString) or it can be connected to an external item of data like (`BindInt(*int)).

Widgets that support binding typically have a ...WithData constructor to set up the binding when creating the widget. You can also call Bind() and Unbind() to manage the data of an existing widget. The following example shows how you can manage a String data item that is bound to a simple Label widget.

package main

import (


func main() {
	a := app.New()
	w := a.NewWindow("Hello")

	str := binding.NewString()
	go func() {
		dots := "....."
		for i := 5; i >= 0; i-- {
			str.Set("Count down" + dots[:i])
		str.Set("Blast off!")


You can find out more in the data binding section of this site.