Documentation ¶
Index ¶
- Variables
- func CanvasForObject(obj fyne.CanvasObject) fyne.Canvas
- type Canvas
- func (c *Canvas) AddShortcut(shortcut fyne.Shortcut, handler func(shortcut fyne.Shortcut))
- func (c *Canvas) CheckDirtyAndClear() bool
- func (c *Canvas) DrawDebugOverlay(obj fyne.CanvasObject, pos fyne.Position, size fyne.Size)
- func (c *Canvas) EnsureMinSize() bool
- func (c *Canvas) Focus(obj fyne.Focusable)
- func (c *Canvas) FocusGained()
- func (c *Canvas) FocusLost()
- func (c *Canvas) FocusNext()
- func (c *Canvas) FocusPrevious()
- func (c *Canvas) Focused() fyne.Focusable
- func (c *Canvas) FreeDirtyTextures() (freed uint64)
- func (c *Canvas) Initialize(impl SizeableCanvas, onOverlayChanged func())
- func (c *Canvas) ObjectTrees() []fyne.CanvasObject
- func (c *Canvas) Overlays() fyne.OverlayStack
- func (c *Canvas) Painter() gl.Painter
- func (c *Canvas) Refresh(obj fyne.CanvasObject)
- func (c *Canvas) RemoveShortcut(shortcut fyne.Shortcut)
- func (c *Canvas) SetContentTreeAndFocusMgr(content fyne.CanvasObject)
- func (c *Canvas) SetDirty()
- func (c *Canvas) SetMenuTreeAndFocusMgr(menu fyne.CanvasObject)
- func (c *Canvas) SetMobileWindowHeadTree(head fyne.CanvasObject)
- func (c *Canvas) SetPainter(p gl.Painter)
- func (c *Canvas) TypedShortcut(shortcut fyne.Shortcut)
- func (c *Canvas) Unfocus()
- func (c *Canvas) WalkTrees(beforeChildren func(*RenderCacheNode, fyne.Position), ...)
- type RenderCacheNode
- type SizeableCanvas
- type Window
Constants ¶
This section is empty.
Variables ¶
var DonePool = sync.Pool{ New: func() any { return make(chan struct{}) }, }
Functions ¶
func CanvasForObject ¶
func CanvasForObject(obj fyne.CanvasObject) fyne.Canvas
CanvasForObject returns the canvas for the specified object.
Types ¶
type Canvas ¶
type Canvas struct { sync.RWMutex OnFocus func(obj fyne.Focusable) OnUnfocus func() // contains filtered or unexported fields }
Canvas defines common canvas implementation.
func (*Canvas) AddShortcut ¶
AddShortcut adds a shortcut to the canvas.
func (*Canvas) CheckDirtyAndClear ¶
CheckDirtyAndClear returns true if the canvas is dirty and clears the dirty state atomically.
func (*Canvas) DrawDebugOverlay ¶
func (*Canvas) FocusGained ¶
func (c *Canvas) FocusGained()
FocusGained signals to the manager that its content got focus. Valid only on Desktop.
func (*Canvas) FocusLost ¶
func (c *Canvas) FocusLost()
FocusLost signals to the manager that its content lost focus. Valid only on Desktop.
func (*Canvas) FocusPrevious ¶
func (c *Canvas) FocusPrevious()
FocusPrevious focuses the previous focusable item.
func (*Canvas) FreeDirtyTextures ¶
FreeDirtyTextures frees dirty textures and returns the number of freed textures.
func (*Canvas) Initialize ¶
func (c *Canvas) Initialize(impl SizeableCanvas, onOverlayChanged func())
Initialize initializes the canvas.
func (*Canvas) ObjectTrees ¶
func (c *Canvas) ObjectTrees() []fyne.CanvasObject
ObjectTrees return canvas object trees.
This function uses lock.
func (*Canvas) Overlays ¶
func (c *Canvas) Overlays() fyne.OverlayStack
Overlays returns the overlay stack.
func (*Canvas) Refresh ¶
func (c *Canvas) Refresh(obj fyne.CanvasObject)
Refresh refreshes a canvas object.
func (*Canvas) RemoveShortcut ¶
RemoveShortcut removes a shortcut from the canvas.
func (*Canvas) SetContentTreeAndFocusMgr ¶
func (c *Canvas) SetContentTreeAndFocusMgr(content fyne.CanvasObject)
SetContentTreeAndFocusMgr sets content tree and focus manager.
This function does not use the canvas lock.
func (*Canvas) SetMenuTreeAndFocusMgr ¶
func (c *Canvas) SetMenuTreeAndFocusMgr(menu fyne.CanvasObject)
SetMenuTreeAndFocusMgr sets menu tree and focus manager.
This function does not use the canvas lock.
func (*Canvas) SetMobileWindowHeadTree ¶
func (c *Canvas) SetMobileWindowHeadTree(head fyne.CanvasObject)
SetMobileWindowHeadTree sets window head tree.
This function does not use the canvas lock.
func (*Canvas) SetPainter ¶
SetPainter sets the canvas painter.
func (*Canvas) TypedShortcut ¶
TypedShortcut handle the registered shortcut.
func (*Canvas) Unfocus ¶
func (c *Canvas) Unfocus()
Unfocus unfocuses all the objects in the canvas.
func (*Canvas) WalkTrees ¶
func (c *Canvas) WalkTrees( beforeChildren func(*RenderCacheNode, fyne.Position), afterChildren func(*RenderCacheNode, fyne.Position), )
WalkTrees walks over the trees.
type RenderCacheNode ¶
type RenderCacheNode struct {
// contains filtered or unexported fields
}
RenderCacheNode represents a node in a render cache tree.
func (*RenderCacheNode) Obj ¶
func (r *RenderCacheNode) Obj() fyne.CanvasObject
Obj returns the node object.
type SizeableCanvas ¶
SizeableCanvas defines a canvas with size related functions.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window defines common functionality for windows.
func (*Window) DestroyEventQueue ¶
func (w *Window) DestroyEventQueue()
DestroyEventQueue destroys the event queue.
func (*Window) InitEventQueue ¶
func (w *Window) InitEventQueue()
InitEventQueue initializes the event queue.
func (*Window) QueueEvent ¶
func (w *Window) QueueEvent(fn func())
QueueEvent uses this method to queue up a callback that handles an event. This ensures user interaction events for a given window are processed in order.
func (*Window) RunEventQueue ¶
func (w *Window) RunEventQueue()
RunEventQueue runs the event queue. This should called inside a go routine. This function blocks.
func (*Window) WaitForEvents ¶
func (w *Window) WaitForEvents()
WaitForEvents wait for all the events.