package driver
import "fyne.io/fyne/v2/internal/driver"
Index ¶
- func AbsolutePositionForObject(object fyne.CanvasObject, trees []fyne.CanvasObject) fyne.Position
- func FindObjectAtPositionMatching(mouse fyne.Position, matches func(object fyne.CanvasObject) bool, overlay fyne.CanvasObject, roots ...fyne.CanvasObject) (fyne.CanvasObject, fyne.Position, int)
- func ReverseWalkVisibleObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
- func WalkCompleteObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
- func WalkVisibleObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
- type WithContext
Functions ¶
func AbsolutePositionForObject ¶
func AbsolutePositionForObject(object fyne.CanvasObject, trees []fyne.CanvasObject) fyne.Position
AbsolutePositionForObject returns the absolute position of an object in a set of object trees. If the object is not part of any of the trees, the position (0,0) is returned.
func FindObjectAtPositionMatching ¶
func FindObjectAtPositionMatching(mouse fyne.Position, matches func(object fyne.CanvasObject) bool, overlay fyne.CanvasObject, roots ...fyne.CanvasObject) (fyne.CanvasObject, fyne.Position, int)
FindObjectAtPositionMatching is used to find an object in a canvas at the specified position. The matches function determines of the type of object that is found at this position is of a suitable type. The various canvas roots and overlays that can be searched are also passed in.
func ReverseWalkVisibleObjectTree ¶
func ReverseWalkVisibleObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
ReverseWalkVisibleObjectTree will walk an object tree in reverse order for all visible objects executing the passed functions following the following rules: - beforeChildren is called for the start obj before traversing its children - the obj's children are traversed by calling walkObjects on each of the visible items - afterChildren is called for the obj after traversing the obj's children The walk can be aborted by returning true in one of the functions:
- if beforeChildren returns true, further traversing is stopped immediately, the after function will not be called for the obj where the walk stopped, however, it will be called for all its parents
func WalkCompleteObjectTree ¶
func WalkCompleteObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
WalkCompleteObjectTree will walk an object tree for all objects (ignoring visible state) executing the passed functions following the following rules: - beforeChildren is called for the start obj before traversing its children - the obj's children are traversed by calling walkObjects on each of the items - afterChildren is called for the obj after traversing the obj's children The walk can be aborted by returning true in one of the functions:
- if beforeChildren returns true, further traversing is stopped immediately, the after function will not be called for the obj where the walk stopped, however, it will be called for all its parents
func WalkVisibleObjectTree ¶
func WalkVisibleObjectTree( obj fyne.CanvasObject, beforeChildren func(fyne.CanvasObject, fyne.Position, fyne.Position, fyne.Size) bool, afterChildren func(fyne.CanvasObject, fyne.Position, fyne.CanvasObject), ) bool
WalkVisibleObjectTree will walk an object tree for all visible objects executing the passed functions following the following rules: - beforeChildren is called for the start obj before traversing its children - the obj's children are traversed by calling walkObjects on each of the visible items - afterChildren is called for the obj after traversing the obj's children The walk can be aborted by returning true in one of the functions:
- if beforeChildren returns true, further traversing is stopped immediately, the after function will not be called for the obj where the walk stopped, however, it will be called for all its parents
Types ¶
type WithContext ¶
type WithContext interface { RunWithContext(f func()) RescaleContext() Context() any }
WithContext allows drivers to execute within another context. Mostly this helps GLFW code execute within the painter's GL context.
Source Files ¶
context.go util.go
Directories ¶
Path | Synopsis |
---|---|
internal/driver/common | |
internal/driver/glfw | Package glfw provides a full Fyne desktop driver that uses the system OpenGL libraries. |
internal/driver/mobile | |
internal/driver/mobile/app | Package app lets you write portable all-Go apps for Android and iOS. |
internal/driver/mobile/event | |
internal/driver/mobile/event/key | Package key defines an event for physical keyboard keys. |
internal/driver/mobile/event/lifecycle | Package lifecycle defines an event for an app's lifecycle. |
internal/driver/mobile/event/paint | Package paint defines an event for the app being ready to paint. |
internal/driver/mobile/event/size | Package size defines an event for the dimensions, physical resolution and orientation of the app's window. |
internal/driver/mobile/event/touch | Package touch defines an event for touch input. |
internal/driver/mobile/gl | Package gl implements Go bindings for OpenGL ES 2.0 and ES 3.0. |
internal/driver/mobile/mobileinit | Package mobileinit contains common initialization logic for mobile platforms that is relevant to both all-Go apps and gobind-based apps. |
- Version
- v2.5.4 (latest)
- Published
- Feb 1, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 month ago –
Tools for package owners.