common

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

func (c *Canvas) AddShortcut(shortcut fyne.Shortcut, handler func(shortcut fyne.Shortcut))

AddShortcut adds a shortcut to the canvas.

func (*Canvas) EnsureMinSize

func (c *Canvas) EnsureMinSize() bool

EnsureMinSize ensure canvas min size.

This function uses lock.

func (*Canvas) Focus

func (c *Canvas) Focus(obj fyne.Focusable)

Focus makes the provided item focused.

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) FocusNext

func (c *Canvas) FocusNext()

FocusNext focuses the next focusable item.

func (*Canvas) FocusPrevious

func (c *Canvas) FocusPrevious()

FocusPrevious focuses the previous focusable item.

func (*Canvas) Focused

func (c *Canvas) Focused() fyne.Focusable

Focused returns the current focused object.

func (*Canvas) FreeDirtyTextures

func (c *Canvas) FreeDirtyTextures() uint64

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) IsDirty

func (c *Canvas) IsDirty() bool

IsDirty checks if the canvas is dirty.

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) Painter

func (c *Canvas) Painter() gl.Painter

Painter returns the canvas painter.

func (*Canvas) Refresh

func (c *Canvas) Refresh(obj fyne.CanvasObject)

Refresh refreshes a canvas object.

func (*Canvas) RemoveShortcut

func (c *Canvas) RemoveShortcut(shortcut fyne.Shortcut)

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) SetDirty

func (c *Canvas) SetDirty(dirty bool)

SetDirty sets canvas dirty flag.

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

func (c *Canvas) SetPainter(p gl.Painter)

SetPainter sets the canvas painter.

func (*Canvas) TypedShortcut

func (c *Canvas) TypedShortcut(shortcut fyne.Shortcut)

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),
)

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

Obj returns the node object.

type SizeableCanvas

type SizeableCanvas interface {
	fyne.Canvas
	Resize(fyne.Size)
	MinSize() fyne.Size
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL