widget

package
v0.0.0-...-7804c9d Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activater

type Activater interface {
	Activate()
}

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Deactivater

type Deactivater interface {
	Deactivate()
}

type Labeler

type Labeler interface {
	Label() string
}

type Layouter

type Layouter interface {
	Layout(C) D
}

type Tab

type Tab struct {
	Label        string
	W            Layouter
	Closeable    bool
	CloseButton  widget.Clickable
	BecameActive bool
	// contains filtered or unexported fields
}

func NewTab

func NewTab(label string, w Layouter, closeable bool) *Tab

func (*Tab) GetLabel

func (t *Tab) GetLabel() string

func (*Tab) Layout

func (t *Tab) Layout(gtx C) D

func (*Tab) LayoutButton

func (t *Tab) LayoutButton(gtx C, w layout.Widget) D

type TabEvent

type TabEvent struct {
	Type TabEventType
	Tab  Layouter
}

type TabEventType

type TabEventType int
const (
	TabEventClose TabEventType = iota
	TabEventActivate
)

type Tabbar

type Tabbar struct {
	Tabs []*Tab

	Active *Tab
	// contains filtered or unexported fields
}

func NewTabbar

func NewTabbar(tabs ...*Tab) *Tabbar

func (*Tabbar) Activate

func (tb *Tabbar) Activate(key interface{})

func (*Tabbar) ActiveIndex

func (tb *Tabbar) ActiveIndex() int

func (*Tabbar) Append

func (tb *Tabbar) Append(t *Tab)

func (*Tabbar) Close

func (tb *Tabbar) Close(index int)

Close closes the indicated tab. You cannot close the active tab.

func (*Tabbar) Events

func (tb *Tabbar) Events(gtx layout.Context) []TabEvent

func (*Tabbar) IndexOf

func (tb *Tabbar) IndexOf(key interface{}) int

func (*Tabbar) Insert

func (tb *Tabbar) Insert(index int, t *Tab)

func (*Tabbar) InsertAfter

func (tb *Tabbar) InsertAfter(after, new *Tab)

func (*Tabbar) Next

func (tb *Tabbar) Next()

func (*Tabbar) Prev

func (tb *Tabbar) Prev()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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