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.StaticResource"
fyne.StaticResource
import "fyne.io/fyne/v2"
Usage
type StaticResource
type StaticResource struct {
StaticName string
StaticContent []byte
}
StaticResource is a bundled resource compiled into the application. These resources are normally generated by the fyne_bundle command included in the Fyne toolkit.
func NewStaticResource
func NewStaticResource(name string, content []byte) *StaticResource
NewStaticResource returns a new static resource object with the specified name and content. Creating a new static resource in memory results in sharable binary data that may be serialised to the system cache location.
func (*StaticResource) Content
func (r *StaticResource) Content() []byte
Content returns the bytes of the bundled resource, no compression is applied but any compression on the resource is retained.
func (*StaticResource) GoString
func (r *StaticResource) GoString() string
GoString converts a Resource object to Go code. This is useful if serialising to a Go file for compilation into a binary.
func (*StaticResource) Name
func (r *StaticResource) Name() string
Name returns the unique name of this resource, usually matching the file it was generated from.