Fyne API "fyne"

fyne


import "fyne.io/fyne"

Package fyne describes the objects and components available to any Fyne app. These can all be created, manipulated and tested without rendering (for speed). Your main package should use the app package to create an application with a default driver that will render your UI.

A simple application may look like this:

    package main

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

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

    	hello := widget.NewLabel("Hello Fyne!")
    	w.SetContent(widget.NewVBox(
    		hello,
    		widget.NewButton("Hi!", func() {
    			hello.SetText("Welcome :)")
    		}),
    	))

    	w.ShowAndRun()
    }

Usage

const SettingsScaleAuto = float32(-1.0)

SettingsScaleAuto is a specific scale value that indicates a canvas should scale according to the DPI of the window that contains it.

Deprecated: Automatic scaling is now handled in the drivers and is not a user setting.

func IsHorizontal

func IsHorizontal(orient DeviceOrientation) bool

IsHorizontal is a helper utility that determines if a passed orientation is horizontal

func IsVertical

func IsVertical(orient DeviceOrientation) bool

IsVertical is a helper utility that determines if a passed orientation is vertical

func LogError

func LogError(reason string, err error)

LogError reports an error to the command line with the specified err cause, if not nil. The function also reports basic information about the code location.

func Max

func Max(x, y int) int

Max returns the larger of the passed values.

func Min

func Min(x, y int) int

Min returns the smaller of the passed values.

func SetCurrentApp

func SetCurrentApp(current App)

SetCurrentApp is an internal function to set the app instance currently running.

types