widget

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultHistogramBins = 100

Variables

This section is empty.

Functions

func ColorTextMaterial added in v0.2.0

func ColorTextMaterial(gtx layout.Context, c color.NRGBA) op.CallOp

Types

type Activatable added in v0.3.0

type Activatable struct {
	Clickable
	// contains filtered or unexported fields
}

Clickable represents a clickable area.

func (*Activatable) Focus added in v0.3.0

func (b *Activatable) Focus()

Focus requests the input focus for the element.

func (*Activatable) Focused added in v0.3.0

func (b *Activatable) Focused() bool

Focused reports whether b has focus.

func (*Activatable) Layout added in v0.3.0

Layout and update the button state.

func (*Activatable) Update added in v0.4.0

func (b *Activatable) Update(gtx layout.Context) []Click

Update the button state by processing events, and return the resulting clicks, if any.

type BackedBit added in v0.2.0

type BackedBit[T uint8 | uint16 | uint32 | uint64] struct {
	Bits *T
	Bit  int
	// contains filtered or unexported fields
}

func (*BackedBit[T]) Changed added in v0.2.0

func (bit *BackedBit[T]) Changed() bool

func (*BackedBit[T]) Focused added in v0.2.0

func (bit *BackedBit[T]) Focused() bool

Focused reports whether the element is focused.

func (*BackedBit[T]) Get added in v0.2.0

func (bit *BackedBit[T]) Get() bool

func (*BackedBit[T]) Hovered added in v0.2.0

func (bit *BackedBit[T]) Hovered() bool

Hovered reports whether pointer is over the element.

func (*BackedBit[T]) Layout added in v0.2.0

func (bit *BackedBit[T]) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

func (*BackedBit[T]) Pressed added in v0.2.0

func (bit *BackedBit[T]) Pressed() bool

Pressed reports whether pointer is pressing the element.

func (*BackedBit[T]) Set added in v0.2.0

func (bit *BackedBit[T]) Set(b bool)

func (*BackedBit[T]) Update added in v0.4.0

func (bit *BackedBit[T]) Update(gtx layout.Context) bool

type Bool

type Bool struct {
	Value bool
	// contains filtered or unexported fields
}

func (*Bool) Focused

func (b *Bool) Focused() bool

Focused reports whether b has focus.

func (*Bool) Get added in v0.2.0

func (b *Bool) Get() bool

func (*Bool) Hovered

func (b *Bool) Hovered() bool

Hovered reports whether pointer is over the element.

func (*Bool) Layout

func (b *Bool) Layout(gtx layout.Context, w layout.Widget) layout.Dimensions

func (*Bool) Pressed

func (b *Bool) Pressed() bool

Pressed reports whether pointer is pressing the element.

func (*Bool) Set added in v0.2.0

func (b *Bool) Set(v bool)

func (*Bool) Update added in v0.4.0

func (b *Bool) Update(gtx layout.Context) bool

Update the widget state and report whether Value was changed.

type Boolean added in v0.2.0

type Boolean interface {
	Set(bool)
	Get() bool
	Update(layout.Context) bool
	Layout(layout.Context, layout.Widget) layout.Dimensions
}

type ChangeEvent

type ChangeEvent = widget.ChangeEvent

type Click

type Click struct {
	Button    pointer.Buttons
	Modifiers key.Modifiers
	NumClicks int
}

Click represents a click.

type Clickable

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

Clickable represents a clickable area.

func (*Clickable) Click

func (b *Clickable) Click(btn pointer.Buttons)

Click executes a simple programmatic click.

func (*Clickable) Clicked

func (b *Clickable) Clicked(gtx layout.Context) (Click, bool)

Clicked reports whether there are pending clicks as would be reported by Clicks. If so, Clicked removes the earliest click.

func (*Clickable) Hovered

func (b *Clickable) Hovered() bool

Hovered reports whether a pointer is over the element.

func (*Clickable) Layout

Layout and update the button state.

func (*Clickable) Pressed

func (b *Clickable) Pressed(btn pointer.Buttons) bool

Pressed reports whether a pointer is pressing the element.

func (*Clickable) Update added in v0.4.0

func (b *Clickable) Update(gtx layout.Context) []Click

Update the button state by processing events, and return the resulting clicks, if any.

type Editor

type Editor = widget.Editor

type FlameGraph added in v0.4.0

type FlameGraph struct {
	Samples []FlamegraphFrame
}

func (*FlameGraph) AddSample added in v0.4.0

func (fg *FlameGraph) AddSample(sample FlamegraphSample, root string)

func (*FlameGraph) Compute added in v0.4.0

func (fg *FlameGraph) Compute()

type FlamegraphFrame added in v0.4.0

type FlamegraphFrame struct {
	Name     string
	Duration time.Duration
	Children []FlamegraphFrame
}

type FlamegraphSample added in v0.4.0

type FlamegraphSample []FlamegraphFrame

type FloatDuration added in v0.3.0

type FloatDuration float64

func (FloatDuration) Ceil added in v0.3.0

func (d FloatDuration) Ceil() time.Duration

func (FloatDuration) Floor added in v0.3.0

func (d FloatDuration) Floor() time.Duration

type GIF added in v0.4.0

type GIF struct {
	GIF *gif.GIF
	// contains filtered or unexported fields
}

func NewGIF added in v0.4.0

func NewGIF(g *gif.GIF) *GIF

func (*GIF) Layout added in v0.4.0

func (g *GIF) Layout(gtx layout.Context, dir layout.Direction) layout.Dimensions

type Histogram added in v0.3.0

type Histogram struct {
	// The config that was passed to NewHistogram
	Config      *HistogramConfig
	Start       FloatDuration
	Bins        []int
	BinWidth    FloatDuration
	Overflow    FloatDuration
	MaxValue    time.Duration
	MaxBinValue int
}

func NewHistogram added in v0.3.0

func NewHistogram(cfg *HistogramConfig, values []time.Duration) *Histogram

func (*Histogram) BucketRange added in v0.3.0

func (hist *Histogram) BucketRange(i int) (start, end FloatDuration)

func (*Histogram) HasOverflow added in v0.3.0

func (hist *Histogram) HasOverflow() bool

type HistogramConfig added in v0.3.0

type HistogramConfig struct {
	Start, End     FloatDuration
	RejectOutliers bool
	Bins           int
}

type Image

type Image = widget.Image

type Label

type Label = widget.Label

type List

type List struct {
	Main        Scrollbar
	Cross       Scrollbar
	CrossOffset float32
	Widest      int
	layout.List
}

type PrimaryActivatable added in v0.3.0

type PrimaryActivatable struct {
	Activatable
}

PrimaryActivatable is like Activatable but ignores all press and click events for buttons other than the primary one.

func (*PrimaryActivatable) Click added in v0.3.0

func (b *PrimaryActivatable) Click()

func (*PrimaryActivatable) Clicked added in v0.3.0

func (b *PrimaryActivatable) Clicked(gtx layout.Context) bool

func (*PrimaryActivatable) Focus added in v0.3.0

func (b *PrimaryActivatable) Focus()

func (*PrimaryActivatable) Focused added in v0.3.0

func (b *PrimaryActivatable) Focused() bool

func (*PrimaryActivatable) Hovered added in v0.3.0

func (b *PrimaryActivatable) Hovered() bool

func (*PrimaryActivatable) Layout added in v0.3.0

func (*PrimaryActivatable) Pressed added in v0.3.0

func (b *PrimaryActivatable) Pressed() bool

type PrimaryClickable

type PrimaryClickable struct {
	Clickable
}

PrimaryClickable is like Clickable but ignores all press and click events for buttons other than the primary one.

func (*PrimaryClickable) Click

func (b *PrimaryClickable) Click()

func (*PrimaryClickable) Clicked

func (b *PrimaryClickable) Clicked(gtx layout.Context) bool

func (*PrimaryClickable) Hovered

func (b *PrimaryClickable) Hovered() bool

func (*PrimaryClickable) Layout

func (*PrimaryClickable) Pressed

func (b *PrimaryClickable) Pressed() bool

type Scrollbar

type Scrollbar = widget.Scrollbar

type Selectable added in v0.3.0

type Selectable = widget.Selectable

type SubmitEvent

type SubmitEvent = widget.SubmitEvent

Jump to

Keyboard shortcuts

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