Skip to content

Namespace

Andy Williams edited this page Apr 2, 2024 · 4 revisions

The fyne APIs are complex and so are arranged in packages to make them easy to understand. It is easy to install everything with a single go get. The major version of the API must be included per Go's design for not accidentally breaking imports on a major jump.

  • go get fyne.io/fyne/v2

And the main imports are:

    import "fyne.io/fyne/v2/app"
    import "fyne.io/fyne/v2/canvas"
    import "fyne.io/fyne/v2/widget"

The app package provides the entry-point for full applications - usually app.New(). The canvas package provides the basic graphical elements and widget is the place for user interface widget definitions.

Less commonly used packages are theme to work with the themable aspects of Fyne, layout to work with various layout options and driver where the core drivers are stored. You can also use the test package to work with unit tests in your code.