fynetree

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchTree

type BranchTree struct {
	widget.Tree
	*generation.TreeModelRegistry
	OnTapped func(id widget.TreeNodeID, model generation.TreeModel, event *fyne.PointEvent) // OnTapped is called by the branchNode that receives an event from Fyne.

}

BranchTree is a widget.Tree implementation that manages IDs through generation.TreeModelRegistry. This is designed to be the gatekeeper for all widget and model mutations.

func NewBranchTree

func NewBranchTree(modelRoots ...generation.TreeModel) *BranchTree

NewBranchTree initializes the tree and adds all modelRoots to the registry.

func (*BranchTree) AddChild

func (t *BranchTree) AddChild(parentID widget.TreeNodeID, data generation.TreeModel) (widget.TreeNodeID, error)

func (*BranchTree) RemoveChild

func (t *BranchTree) RemoveChild(dataID widget.TreeNodeID)

func (*BranchTree) Tapped

func (t *BranchTree) Tapped(id widget.TreeNodeID, event *fyne.PointEvent)

type Interface

type Interface interface {
	NewTree(modelRoots ...generation.TreeModel) *BranchTree

	NewRoot(title string) *Object
	RootAddChild(root *Object, title string)

	NewBranch(title string) *Object
	BranchAddChild(branch *Object, title string)

	NewNode(title string) *Object
	NodeAddChild(node *Object, title string)
}

func New

func New() Interface

type Object

type Object struct {
	// contains filtered or unexported fields
}

func (*Object) AddChild

func (o *Object) AddChild(model generation.TreeModel) error

func (*Object) AddChildAt

func (o *Object) AddChildAt(i int, model generation.TreeModel) error

func (*Object) Children

func (o *Object) Children() []generation.TreeModel

func (*Object) DisplayIcon

func (o *Object) DisplayIcon() fyne.Resource

func (*Object) DisplayString

func (o *Object) DisplayString() string

func (*Object) RemoveChild

func (o *Object) RemoveChild() generation.TreeModel

func (*Object) RemoveChildAt

func (o *Object) RemoveChildAt(i int) generation.TreeModel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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