fyne (package)
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 = -1AnimationRepeatForever is an AnimationCount value that indicates it should not stop looping.
2.0const KeyModifierShortcutDefault = KeyModifierSuperKeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).
2.2const KeyModifierShortcutDefault = KeyModifierControlKeyModifierShortcutDefault is the default key modifier for shortcuts (Control or Command).
2.2var (
// 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 Do
func Do(fn func())Do is used to execute a specified function in the main Fyne runtime context without waiting. This is required when a background process wishes to adjust graphical elements of a running app. Developers should use this only from within goroutines they have created and when the result does not have to be waited for.
2.6func DoAndWait
func DoAndWait(fn func())DoAndWait is used to execute a specified function in the main Fyne runtime context. This is required when a background process wishes to adjust graphical elements of a running app. Developers should use this only from within goroutines they have created.
2.6func IsHorizontal
func IsHorizontal(orient DeviceOrientation) boolIsHorizontal is a helper utility that determines if a passed orientation is horizontal
func IsVertical
func IsVertical(orient DeviceOrientation) boolIsVertical 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) float32Max returns the larger of the passed values.
func Min
func Min(x, y float32) float32Min 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
- Locale
- MainMenu
- Menu
- MenuItem
- Notification
- OverlayStack
- PointEvent
- Position
- Preferences
- Resource
- ScrollDirection
- ScrollEvent
- Scrollable
- SecondaryTappable
- Settings
- Shortcut
- ShortcutCopy
- ShortcutCut
- ShortcutHandler
- ShortcutPaste
- ShortcutRedo
- ShortcutSelectAll
- ShortcutUndo
- Shortcutable
- Size
- StaticResource
- Storage
- StringValidator
- Tabbable
- Tappable
- TextAlign
- TextStyle
- TextTruncation
- TextWrap
- Theme
- ThemeColorName
- ThemeIconName
- ThemeSizeName
- ThemeVariant
- ThemedResource
- URI
- URIReadCloser
- URIWithIcon
- URIWriteCloser
- Validatable
- Vector2
- Widget
- WidgetRenderer
- Window