Upgrade to v2.5
Fyne API v2.5
package fyne
Animation
AnimationCurve
App
AppMetadata
BuildType
Canvas
CanvasObject
Clipboard
CloudProvider
CloudProviderPreferences
CloudProviderStorage
Container
Delta
Device
DeviceOrientation
Disableable
DoubleTappable
DragEvent
Draggable
Driver
Focusable
HardwareKey
KeyboardShortcut
KeyEvent
KeyModifier
KeyName
Layout
LegacyTheme
Lifecycle
ListableURI
Locale
MainMenu
Menu
MenuItem
Notification
OverlayStack
PointEvent
Position
Preferences
Resource
Scrollable
ScrollEvent
SecondaryTappable
Settings
Shortcut
Shortcutable
ShortcutCopy
ShortcutCut
ShortcutHandler
ShortcutPaste
ShortcutRedo
ShortcutSelectAll
ShortcutUndo
Size
StaticResource
Storage
StringValidator
Tabbable
Tappable
TextAlign
TextStyle
TextTruncation
TextWrap
Theme
ThemeColorName
ThemedResource
ThemeIconName
ThemeSizeName
ThemeVariant
URI
URIReadCloser
URIWithIcon
URIWriteCloser
Validatable
Vector2
Widget
WidgetRenderer
Window
app
canvas
container
data/binding
data/validation
dialog
driver
driver/desktop
driver/mobile
driver/software
lang
layout
storage
storage/repository
test
theme
widget
Fyne API "fyne.WidgetRenderer"
fyne.WidgetRenderer
import "fyne.io/fyne/v2"
Usage
type WidgetRenderer
type WidgetRenderer interface {
// Destroy is a hook that is called when the renderer is being destroyed.
// This happens at some time after the widget is no longer visible, and
// once destroyed, a renderer will not be reused.
// Renderers should dispose and clean up any related resources, if necessary.
Destroy()
// Layout is a hook that is called if the widget needs to be laid out.
// This should never call [Refresh].
Layout(Size)
// MinSize returns the minimum size of the widget that is rendered by this renderer.
MinSize() Size
// Objects returns all objects that should be drawn.
Objects() []CanvasObject
// Refresh is a hook that is called if the widget has updated and needs to be redrawn.
// This might trigger a [Layout].
Refresh()
}
WidgetRenderer defines the behaviour of a widget’s implementation. This is returned from a widget’s declarative object through [Widget.CreateRenderer] and should be exactly one instance per widget in memory.