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.
2.0
const KeyModifierShortcutDefault = KeyModifierSuper
KeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).
2.2
const KeyModifierShortcutDefault = KeyModifierControl
KeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).
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
- Animation
- AnimationCurve
- App
- AppMetadata
- BuildType
- Canvas
- CanvasObject
- Clipboard
- CloudProvider
- CloudProviderPreferences
- CloudProviderStorage
- Container
- Delta
- Device
- DeviceOrientation
- Disableable
- DoubleTappable
- DragEvent
- Draggable
- Driver
- Focusable
- HardwareKey
- KeyEvent
- KeyModifier
- KeyName
- KeyboardShortcut
- Layout
- LegacyTheme
- Lifecycle
- ListableURI
- MainMenu
- Menu
- MenuItem
- Notification
- OverlayStack
- PointEvent
- Position
- Preferences
- Resource
- ScrollEvent
- Scrollable
- SecondaryTappable
- Settings
- Shortcut
- ShortcutCopy
- ShortcutCut
- ShortcutHandler
- ShortcutPaste
- ShortcutSelectAll
- Shortcutable
- Size
- StaticResource
- Storage
- StringValidator
- Tabbable
- Tappable
- TextAlign
- TextStyle
- TextTruncation
- TextWrap
- Theme
- ThemeColorName
- ThemeIconName
- ThemeSizeName
- ThemeVariant
- URI
- URIReadCloser
- URIWriteCloser
- Validatable
- Vector2
- Widget
- WidgetRenderer
- Window