Fyne API "fyne"

fyne


import "fyne.io/fyne/v2"

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/v2/app"
    import "fyne.io/fyne/v2/container"
    import "fyne.io/fyne/v2/widget"

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

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

    	w.ShowAndRun()
    }

Usage

const AnimationRepeatForever = -1

AnimationRepeatForever is an AnimationCount value that indicates it should not stop looping.

Since: 2.0
const KeyModifierShortcutDefault = KeyModifierSuper

KeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).

Since: 2.2
const KeyModifierShortcutDefault = KeyModifierControl

KeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).

Since: 2.2
var (
	// AnimationEaseInOut is the default easing, it starts slowly, accelerates to the middle and slows to the end.
	//
	// Since: 2.0
	AnimationEaseInOut = animationEaseInOut
	// AnimationEaseIn starts slowly and accelerates to the end.
	//
	// Since: 2.0
	AnimationEaseIn = animationEaseIn
	// AnimationEaseOut starts at speed and slows to the end.
	//
	// Since: 2.0
	AnimationEaseOut = animationEaseOut
	// AnimationLinear is a linear mapping for animations that progress uniformly through their duration.
	//
	// Since: 2.0
	AnimationLinear = animationLinear
)

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 float32) float32

Max returns the larger of the passed values.

func Min

func Min(x, y float32) float32

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