viewtree

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package viewtree traverses the self-drawn view trees on Windows and Linux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BarAt

func BarAt[V Node[V]](v V, p driver.Point) (V, driver.Point)

BarAt returns the innermost reachable scrollbar and the point in its view's coordinates. If there is no scrollbar at the point, it returns p unchanged.

func Hit

func Hit[V Node[V]](v V, p driver.Point, match func(V) bool) V

Hit returns the topmost matching view. The point is in the parent's content coordinates. An unmatched view lets the search continue below it.

func ViewsAt

func ViewsAt[V Node[V]](v V, p driver.Point, match func(V) bool, out []V) ([]V, bool)

ViewsAt appends matching views along the frontmost pointer path, outermost first. It reports whether the subtree takes the pointer, even if none of its reachable views match. Hidden and fully transparent views pass through.

Types

type Node

type Node[V any] interface {
	comparable
	PointerVisibility() (hidden, transparent bool)
	PointerReach(p driver.Point) (local driver.Point, self, children bool)
	PointerChildren(local driver.Point) (content driver.Point, children []V)
	ScrollbarContains(local driver.Point) bool
}

Node gives the traversal access to a backend's current view geometry.

Jump to

Keyboard shortcuts

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