gui

package
Version: v0.0.2-0...-1c7e8a7 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2021 License: Unlicense Imports: 43 Imported by: 0

Documentation

Overview

Package gui implements the plan 9 from crypto space Gio GUI theme

Index

Constants

View Source
const (
	NW = 1 << iota
	NE
	SW
	SE
)
View Source
const Inf = 1e6

Variables

View Source
var (
	Scales = ScaleType{
		"H1":      96.0 / 16.0,
		"H2":      60.0 / 16.0,
		"H3":      48.0 / 16.0,
		"H4":      34.0 / 16.0,
		"H5":      24.0 / 16.0,
		"H6":      20.0 / 16.0,
		"Body1":   1,
		"Body2":   14.0 / 16.0,
		"Caption": 12.0 / 16.0,
	}
)

Functions

func Check

func Check(err error) bool

func CopyContextDimensionsWithMaxAxis

func CopyContextDimensionsWithMaxAxis(gtx l.Context, size image.Point, axis l.Axis) l.Context

CopyContextDimensionsWithMaxAxis copies the dimensions out with the max set by an image.Point along the axis

func Debug

func Debug(a ...interface{})

func Debugc

func Debugc(fn func() string)

func Debugf

func Debugf(format string, a ...interface{})

func Debugs

func Debugs(a interface{})

func EmptyFromSize

func EmptyFromSize(size image.Point) func(gtx l.Context) l.Dimensions

func EmptyMaxHeight

func EmptyMaxHeight() func(gtx l.Context) l.Dimensions

func EmptyMaxWidth

func EmptyMaxWidth() func(gtx l.Context) l.Dimensions

func EmptyMinHeight

func EmptyMinHeight() func(gtx l.Context) l.Dimensions

func EmptyMinWidth

func EmptyMinWidth() func(gtx l.Context) l.Dimensions

func EmptySpace

func EmptySpace(x, y int) func(gtx l.Context) l.Dimensions

func Error

func Error(a ...interface{})

func Errorc

func Errorc(fn func() string)

func Errorf

func Errorf(format string, a ...interface{})

func Errors

func Errors(a interface{})

func Fatal

func Fatal(a ...interface{})

func Fatalc

func Fatalc(fn func() string)

func Fatalf

func Fatalf(format string, a ...interface{})

func Fatals

func Fatals(a interface{})

func Fill

func Fill(gtx l.Context, col color.NRGBA) l.Dimensions

Fill is a general fill function that covers the background of the current context space

func GetDimension

func GetDimension(gtx l.Context, w l.Widget) (dim l.Dimensions)

func GetInfContext

func GetInfContext(gtx l.Context) l.Context

GetInfContext creates a context with infinite max constraints

func HexARGB

func HexARGB(s string) (c color.RGBA)

HexARGB converts a 32 bit hex string into a color specification

func HexNRGB

func HexNRGB(s string) (c color.NRGBA)

HexNRGB converts a 32 bit hex string into a color specification

func If

func If(value bool, t, f l.Widget) l.Widget

func Info

func Info(a ...interface{})

func Infoc

func Infoc(fn func() string)

func Infof

func Infof(format string, a ...interface{})

func Infos

func Infos(a interface{})

func Trace

func Trace(a ...interface{})

func Tracec

func Tracec(fn func() string)

func Tracef

func Tracef(format string, a ...interface{})

func Traces

func Traces(a interface{})

func Warn

func Warn(a ...interface{})

func Warnc

func Warnc(fn func() string)

func Warnf

func Warnf(format string, a ...interface{})

func Warns

func Warns(a interface{})

Types

type App

type App struct {
	*Window

	MenuOpen bool

	SideBarSize *unit.Value

	Size *int

	PreRendering bool
	Break1       float32
	// contains filtered or unexported fields
}

App defines an application with a header, sidebar/menu, right side button bar, changeable body page widget and pop-over layers

func (*App) ActivePage

func (a *App) ActivePage(activePage string) *App

func (*App) ActivePageGet

func (a *App) ActivePageGet() string

func (*App) ActivePageGetAtomic

func (a *App) ActivePageGetAtomic() *uberatomic.String

func (*App) BodyBackground

func (a *App) BodyBackground(bodyBackground string) *App

func (*App) BodyBackgroundGet

func (a *App) BodyBackgroundGet() string

func (*App) BodyColor

func (a *App) BodyColor(bodyColor string) *App

func (*App) BodyColorGet

func (a *App) BodyColorGet() string

func (*App) ButtonBar

func (a *App) ButtonBar(bar []l.Widget) *App

func (*App) ButtonBarGet

func (a *App) ButtonBarGet() (bar []l.Widget)

func (*App) CardBackground

func (a *App) CardBackground(cardBackground string) *App

func (*App) CardBackgroundGet

func (a *App) CardBackgroundGet() string

func (*App) CardColor

func (a *App) CardColor(cardColor string) *App

func (*App) CardColorGet

func (a *App) CardColorGet() string

func (*App) DimensionCaption

func (a *App) DimensionCaption(gtx l.Context) l.Dimensions

func (*App) Fn

func (a *App) Fn() func(gtx l.Context) l.Dimensions

Fn renders the app widget

func (*App) HideSideBar

func (a *App) HideSideBar(hideSideBar bool) *App

func (*App) HideSideBarGet

func (a *App) HideSideBarGet() bool

func (*App) HideTitleBar

func (a *App) HideTitleBar(hideTitleBar bool) *App

func (*App) HideTitleBarGet

func (a *App) HideTitleBarGet() bool

func (*App) Layers

func (a *App) Layers(widgets []l.Widget) *App

func (*App) LayersGet

func (a *App) LayersGet() []l.Widget

func (*App) LogoAndTitle

func (a *App) LogoAndTitle(gtx l.Context) l.Dimensions

func (*App) MainDirection

func (a *App) MainDirection() l.Direction

func (*App) MainFrame

func (a *App) MainFrame(gtx l.Context) l.Dimensions

func (*App) MenuBackground

func (a *App) MenuBackground(menuBackground string) *App

func (*App) MenuBackgroundGet

func (a *App) MenuBackgroundGet() string

func (*App) MenuButton

func (a *App) MenuButton(gtx l.Context) l.Dimensions

func (*App) MenuColor

func (a *App) MenuColor(menuColor string) *App

func (*App) MenuColorGet

func (a *App) MenuColorGet() string

func (*App) MenuIcon

func (a *App) MenuIcon(menuIcon *[]byte) *App

func (*App) MenuIconGet

func (a *App) MenuIconGet() *[]byte

func (*App) NoMenuButton

func (a *App) NoMenuButton(_ l.Context) l.Dimensions

func (*App) Pages

func (a *App) Pages(widgets WidgetMap) *App

func (*App) PagesGet

func (a *App) PagesGet() WidgetMap

func (*App) Placeholder

func (a *App) Placeholder(title string) func(gtx l.Context) l.Dimensions

func (*App) RenderButtonBar

func (a *App) RenderButtonBar(gtx l.Context) l.Dimensions

func (*App) RenderHeader

func (a *App) RenderHeader(gtx l.Context) l.Dimensions

func (*App) RenderPage

func (a *App) RenderPage(gtx l.Context) l.Dimensions

func (*App) RenderStatusBar

func (a *App) RenderStatusBar(gtx l.Context) l.Dimensions

func (*App) Root

func (a *App) Root(root *Stack) *App

func (*App) RootGet

func (a *App) RootGet() *Stack

func (*App) SetMainDirection

func (a *App) SetMainDirection(direction l.Direction) *App

func (*App) SideBar

func (a *App) SideBar(widgets []l.Widget) *App

func (*App) SideBarBackground

func (a *App) SideBarBackground(sideBarBackground string) *App

func (*App) SideBarBackgroundGet

func (a *App) SideBarBackgroundGet() string

func (*App) SideBarColor

func (a *App) SideBarColor(sideBarColor string) *App

func (*App) SideBarColorGet

func (a *App) SideBarColorGet() string

func (*App) SideBarGet

func (a *App) SideBarGet() []l.Widget

func (*App) StatusBar

func (a *App) StatusBar(bar, barR []l.Widget) *App

func (*App) StatusBarBackground

func (a *App) StatusBarBackground(statusBarBackground string) *App

func (*App) StatusBarBackgroundGet

func (a *App) StatusBarBackgroundGet() string

func (*App) StatusBarColor

func (a *App) StatusBarColor(statusBarColor string) *App

func (*App) StatusBarColorGet

func (a *App) StatusBarColorGet() string

func (*App) StatusBarGet

func (a *App) StatusBarGet() (bar []l.Widget)

func (*App) ThemeHook

func (a *App) ThemeHook(f func()) *App

func (*App) Title

func (a *App) Title(title string) *App

func (*App) TitleBarBackground

func (a *App) TitleBarBackground(TitleBarBackground string) *App

func (*App) TitleBarBackgroundGet

func (a *App) TitleBarBackgroundGet() string

func (*App) TitleBarColor

func (a *App) TitleBarColor(titleBarColor string) *App

func (*App) TitleBarColorGet

func (a *App) TitleBarColorGet() string

func (*App) TitleFont

func (a *App) TitleFont(font string) *App

func (*App) TitleFontGet

func (a *App) TitleFontGet() string

func (*App) TitleGet

func (a *App) TitleGet() string

type Bool

type Bool struct {
	*Window
	// contains filtered or unexported fields
}

func (*Bool) Changed

func (b *Bool) Changed() bool

Changed reports whether value has changed since the last call to Changed

func (*Bool) Fn

func (b *Bool) Fn(gtx layout.Context) layout.Dimensions

Fn renders the events of the boolean widget

func (*Bool) GetValue

func (b *Bool) GetValue() bool

GetValue gets the boolean value stored in the widget

func (*Bool) History

func (b *Bool) History() []press

History returns the history of presses in the buffer

func (*Bool) SetOnChange

func (b *Bool) SetOnChange(fn BoolHook) *Bool

SetOnChange sets the callback function to run when the state changes

func (*Bool) Value

func (b *Bool) Value(value bool)

Value sets the value of the boolean stored in the widget

type BoolHook

type BoolHook func(b bool)

type Border

type Border struct {
	*Window
	// contains filtered or unexported fields
}

Border lays out a widget and draws a border inside it.

func (*Border) Color

func (b *Border) Color(color string) *Border

Color sets the color to render the border in

func (*Border) CornerRadius

func (b *Border) CornerRadius(rad float32) *Border

CornerRadius sets the radius of the curve on the corners

func (*Border) Corners

func (b *Border) Corners(corners int) *Border

Corners sets the corners that are rounded

func (*Border) Embed

func (b *Border) Embed(w layout.Widget) *Border

func (*Border) Fn

func (b *Border) Fn(gtx layout.Context) layout.Dimensions

Fn renders the border

func (*Border) Width

func (b *Border) Width(width float32) *Border

Width sets the width of the border line

type Button

type Button struct {
	*Window
	// contains filtered or unexported fields
}

func (*Button) Background

func (b *Button) Background(background string) *Button

Background sets the background color

func (*Button) Color

func (b *Button) Color(color string) *Button

Color sets the text color

func (*Button) CornerRadius

func (b *Button) CornerRadius(cornerRadius float32) *Button

CornerRadius sets the corner radius (all measurements are scaled from the base text size)

func (*Button) Fn

func (b *Button) Fn(gtx l.Context) l.Dimensions

Fn renders the button

func (*Button) Font

func (b *Button) Font(font string) *Button

Font sets the font style

func (*Button) Inset

func (b *Button) Inset(scale float32) *Button

Inset sets the inset between the button border and the text

func (*Button) SetCancel

func (b *Button) SetCancel(fn func()) *Button

func (*Button) SetClick

func (b *Button) SetClick(fn func()) *Button

func (*Button) SetPress

func (b *Button) SetPress(fn func()) *Button

func (*Button) Text

func (b *Button) Text(text string) *Button

Text sets the text on the button

func (*Button) TextScale

func (b *Button) TextScale(scale float32) *Button

TextScale sets the dimensions of the text as a fraction of the base text size

type ButtonLayout

type ButtonLayout struct {
	*Window
	// contains filtered or unexported fields
}

func (*ButtonLayout) Background

func (b *ButtonLayout) Background(color string) *ButtonLayout

Background sets the background color of the button

func (*ButtonLayout) CornerRadius

func (b *ButtonLayout) CornerRadius(radius float32) *ButtonLayout

CornerRadius sets the radius of the corners of the button

func (*ButtonLayout) Corners

func (b *ButtonLayout) Corners(corners int) *ButtonLayout

Corners sets which corners have the radius of rounding

func (*ButtonLayout) Embed

func (b *ButtonLayout) Embed(w l.Widget) *ButtonLayout

Embed a widget in the button

func (*ButtonLayout) Fn

func (b *ButtonLayout) Fn(gtx l.Context) l.Dimensions

Fn is the function that draws the button and its child widget

func (*ButtonLayout) SetCancel

func (b *ButtonLayout) SetCancel(fn func()) *ButtonLayout

func (*ButtonLayout) SetClick

func (b *ButtonLayout) SetClick(fn func()) *ButtonLayout

func (*ButtonLayout) SetPress

func (b *ButtonLayout) SetPress(fn func()) *ButtonLayout

type CallbackQueue

type CallbackQueue chan func() error

func NewCallbackQueue

func NewCallbackQueue(bufSize int) CallbackQueue

type Cell

type Cell struct {
	l.Widget

	// priority only has meaning for the header row in defining an order of eliminating elements to fit a width.
	// When trimming size to fit width add from highest to lowest priority and stop when dimensions exceed the target.
	Priority int
	// contains filtered or unexported fields
}

type CellGrid

type CellGrid []CellRow

type CellPriorities

type CellPriorities []CellPriority

func (CellPriorities) Len

func (c CellPriorities) Len() int

Len sorts a cell row by priority

func (CellPriorities) Less

func (c CellPriorities) Less(i, j int) bool

func (CellPriorities) Swap

func (c CellPriorities) Swap(i, j int)

type CellPriority

type CellPriority struct {
	Column   int
	Priority int
}

type CellRow

type CellRow []Cell

func (CellRow) GetPriority

func (c CellRow) GetPriority() (out CellPriorities)

type ChangeEvent

type ChangeEvent struct{}

A ChangeEvent is generated for every user change to the text.

type Checkable

type Checkable struct {
	*Window
	// contains filtered or unexported fields
}

func (*Checkable) CheckedStateIcon

func (c *Checkable) CheckedStateIcon(ic *[]byte) *Checkable

CheckedStateIcon loads the icon for the checked state

func (*Checkable) Color

func (c *Checkable) Color(color string) *Checkable

Color sets the color of the checkbox label

func (*Checkable) Fn

func (c *Checkable) Fn(gtx l.Context, checked bool) l.Dimensions

Fn renders the checkbox widget

func (*Checkable) Font

func (c *Checkable) Font(font string) *Checkable

Font sets the font used on the label

func (*Checkable) IconColor

func (c *Checkable) IconColor(color string) *Checkable

IconColor sets the color of the icon

func (*Checkable) Label

func (c *Checkable) Label(txt string) *Checkable

Label sets the label on the checkbox

func (*Checkable) Scale

func (c *Checkable) Scale(size float32) *Checkable

Scale sets the size of the checkbox icon relative to the base font size

func (*Checkable) TextScale

func (c *Checkable) TextScale(scale float32) *Checkable

TextScale sets the size of the font relative to the base text size

func (*Checkable) UncheckedStateIcon

func (c *Checkable) UncheckedStateIcon(ic *[]byte) *Checkable

UncheckedStateIcon loads the icon for the unchecked state

type Checkbox

type Checkbox struct {
	*Checkable
	// contains filtered or unexported fields
}

func (*Checkbox) Fn

func (c *Checkbox) Fn(gtx l.Context) l.Dimensions

Fn renders the checkbox

func (*Checkbox) IconColor

func (c *Checkbox) IconColor(color string) *Checkbox

IconColor sets the color of the icon in the checkbox

func (*Checkbox) IconScale

func (c *Checkbox) IconScale(scale float32) *Checkbox

IconScale sets the scaling of the check icon

func (*Checkbox) SetOnChange

func (c *Checkbox) SetOnChange(fn func(b bool)) *Checkbox

SetOnChange sets the callback when a state change event occurs

func (*Checkbox) Text

func (c *Checkbox) Text(label string) *Checkbox

Text sets the text to be rendered on the checkbox

func (*Checkbox) TextColor

func (c *Checkbox) TextColor(color string) *Checkbox

TextColor sets the color of the text label

func (*Checkbox) TextScale

func (c *Checkbox) TextScale(scale float32) *Checkbox

TextScale sets the scale relative to the base font size for the text label

type Clickable

type Clickable struct {
	*Window

	Events clickEvents
	// contains filtered or unexported fields
}

Clickable represents a clickable area.

func (*Clickable) Clicked

func (c *Clickable) Clicked() bool

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

func (*Clickable) Clicks

func (c *Clickable) Clicks() []click

Clicks returns and clear the clicks since the last call to Clicks.

func (*Clickable) Fn

func (c *Clickable) Fn(gtx l.Context) l.Dimensions

func (*Clickable) History

func (c *Clickable) History() []press

History is the past pointer presses useful for drawing markers. History is retained for a short duration (about a second).

func (*Clickable) SetCancel

func (c *Clickable) SetCancel(fn func()) *Clickable

func (*Clickable) SetClick

func (c *Clickable) SetClick(fn func()) *Clickable

func (*Clickable) SetPress

func (c *Clickable) SetPress(fn func()) *Clickable

type Collection

type Collection []text.FontFace

func (Collection) Font

func (c Collection) Font(font string) (out text.Font, err error)

type Colors

type Colors struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Colors is a map of names to hex strings specifying colors

func (*Colors) GetNRGBAFromName

func (c *Colors) GetNRGBAFromName(co string) color.NRGBA

GetNRGBAFromName returns the named color from the map

func (*Colors) SetTheme

func (c *Colors) SetTheme(dark bool)

SetTheme to dark or light

type Column

type Column struct {
	*Window
	// contains filtered or unexported fields
}

func (*Column) Fn

func (c *Column) Fn(gtx l.Context) l.Dimensions

func (*Column) List

func (c *Column) List(gtx l.Context) (max int, out []l.Widget)

type ColumnRow

type ColumnRow struct {
	Label string
	W     l.Widget
}

type DimensionList

type DimensionList []l.Dimensions

func GetDimensionList

func GetDimensionList(gtx l.Context, length int, listElement ListElement) (dims DimensionList)

GetDimensionList returns a dimensionlist based on the given listelement

func (DimensionList) CoordinateToPosition

func (d DimensionList) CoordinateToPosition(coordinate int, axis l.Axis) (position Position)

CoordinateToPosition converts an absolute coordinate to a list position

func (DimensionList) GetSizes

func (d DimensionList) GetSizes(position Position, axis l.Axis) (total, before int)

func (DimensionList) GetTotal

func (d DimensionList) GetTotal(axis l.Axis) (total int)

func (DimensionList) PositionToCoordinate

func (d DimensionList) PositionToCoordinate(position Position, axis l.Axis) (coordinate int)

PositionToCoordinate converts a list position to absolute coordinate

type Direction

type Direction struct {
	l.Direction
	// contains filtered or unexported fields
}

func (*Direction) Center

func (d *Direction) Center() (out *Direction)

Center sets the relevant direction for the Direction layout

func (*Direction) E

func (d *Direction) E() (out *Direction)

E sets the relevant direction for the Direction layout

func (*Direction) Embed

func (d *Direction) Embed(w l.Widget) *Direction

func (*Direction) Fn

func (d *Direction) Fn(c l.Context) l.Dimensions

Fn the given widget given the context and direction

func (*Direction) N

func (d *Direction) N() (out *Direction)

N sets the relevant direction for the Direction layout

func (*Direction) NE

func (d *Direction) NE() (out *Direction)

NE sets the relevant direction for the Direction layout

func (*Direction) NW

func (d *Direction) NW() (out *Direction)

NW sets the relevant direction for the Direction layout

func (*Direction) S

func (d *Direction) S() (out *Direction)

S sets the relevant direction for the Direction layout

func (*Direction) SE

func (d *Direction) SE() (out *Direction)

SE sets the relevant direction for the Direction layout

func (*Direction) SW

func (d *Direction) SW() (out *Direction)

SW sets the relevant direction for the Direction layout

func (*Direction) W

func (d *Direction) W() (out *Direction)

W sets the relevant direction for the Direction layout

type Editor

type Editor struct {
	Caret struct {

		// Line is the caret line position as an index into lines.
		Line int
		// Col is the caret column measured in runes.
		Col int
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

Editor implements an editable and scrollable text area.

func (*Editor) Alignment

func (e *Editor) Alignment(alignment text.Alignment) *Editor

func (*Editor) CaretCoords

func (e *Editor) CaretCoords() f32.Point

CaretCoords returns the coordinates of the caret, relative to the editor itself.

func (*Editor) CaretPos

func (e *Editor) CaretPos() (line, col int)

CaretPos returns the line & column numbers of the caret.

func (*Editor) Delete

func (e *Editor) Delete(runes int)

Delete runes from the caret position. The sign of runes specifies the direction to delete: positive is forward, negative is backward.

func (*Editor) Events

func (e *Editor) Events() []EditorEvent

Events returns available editor events.

func (*Editor) Focus

func (e *Editor) Focus()

Focus requests the input focus for the _editor.

func (*Editor) Focused

func (e *Editor) Focused() bool

Focused returns whether the editor is focused or not.

func (*Editor) Insert

func (e *Editor) Insert(s string)

Insert inserts text at the caret, moving the caret forward.

func (*Editor) Layout

func (e *Editor) Layout(gtx layout.Context, sh text.Shaper, font text.Font, size unit.Value) layout.Dimensions

Layout lays out the editor.

func (*Editor) Len

func (e *Editor) Len() int

Len is the length of the editor contents.

func (*Editor) Mask

func (e *Editor) Mask(mask rune) *Editor

func (*Editor) Move

func (e *Editor) Move(distance int)

Move the caret: positive distance moves forward, negative distance moves backward.

func (*Editor) NumLines

func (e *Editor) NumLines() int

NumLines returns the number of lines in the editor.

func (*Editor) PaintCaret

func (e *Editor) PaintCaret(gtx layout.Context)

func (*Editor) PaintText

func (e *Editor) PaintText(gtx layout.Context)

func (*Editor) SetChange

func (e *Editor) SetChange(changeFn func(txt string)) *Editor

func (*Editor) SetFocus

func (e *Editor) SetFocus(focusFn func(is bool)) *Editor

func (*Editor) SetSubmit

func (e *Editor) SetSubmit(submitFn func(txt string)) *Editor

func (*Editor) SetText

func (e *Editor) SetText(s string) *Editor

SetText replaces the contents of the editor.

func (*Editor) SingleLine

func (e *Editor) SingleLine() *Editor

func (*Editor) Submit

func (e *Editor) Submit(submit bool) *Editor

func (*Editor) Text

func (e *Editor) Text() string

Text returns the contents of the editor.

type EditorEvent

type EditorEvent interface {
	// contains filtered or unexported methods
}

type Enum

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

func (*Enum) Changed

func (e *Enum) Changed() bool

Changed reports whether Value has changed by user interaction since the last call to Changed.

func (*Enum) Fn

func (e *Enum) Fn(gtx layout.Context, key string) layout.Dimensions

Fn adds the event handler for key.

func (*Enum) SetOnChange

func (e *Enum) SetOnChange(hook func(value string)) *Enum

func (*Enum) SetValue

func (e *Enum) SetValue(value string) *Enum

func (*Enum) Value

func (e *Enum) Value() string

type Filler

type Filler struct {
	*Window
	// contains filtered or unexported fields
}

Filler fills the background of a widget with a specified color and corner radius

func (*Filler) Fn

func (f *Filler) Fn(gtx l.Context) l.Dimensions

Fn renders the fill with the widget inside

type Flex

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

func (*Flex) AlignBaseline

func (f *Flex) AlignBaseline() (out *Flex)

AlignBaseline sets alignment for layout from Baseline

func (*Flex) AlignEnd

func (f *Flex) AlignEnd() (out *Flex)

AlignEnd sets alignment for layout from End

func (*Flex) AlignMiddle

func (f *Flex) AlignMiddle() (out *Flex)

AlignMiddle sets alignment for layout from Middle

func (*Flex) AlignStart

func (f *Flex) AlignStart() (out *Flex)

AlignStart sets alignment for layout from Start

func (*Flex) Flexed

func (f *Flex) Flexed(wgt float32, w l.Widget) (out *Flex)

Flexed inserts a flexed widget into the flex

func (*Flex) Fn

func (f *Flex) Fn(c l.Context) l.Dimensions

Fn runs the ops in the context using the FlexChildren inside it

func (*Flex) Rigid

func (f *Flex) Rigid(w l.Widget) (out *Flex)

Rigid inserts a rigid widget into the flex

func (*Flex) SpaceAround

func (f *Flex) SpaceAround() (out *Flex)

SpaceAround sets the corresponding flex spacing parameter

func (*Flex) SpaceBetween

func (f *Flex) SpaceBetween() (out *Flex)

SpaceBetween sets the corresponding flex spacing parameter

func (*Flex) SpaceEnd

func (f *Flex) SpaceEnd() (out *Flex)

SpaceEnd sets the corresponding flex spacing parameter

func (*Flex) SpaceEvenly

func (f *Flex) SpaceEvenly() (out *Flex)

SpaceEvenly sets the corresponding flex spacing parameter

func (*Flex) SpaceSides

func (f *Flex) SpaceSides() (out *Flex)

SpaceSides sets the corresponding flex spacing parameter

func (*Flex) SpaceStart

func (f *Flex) SpaceStart() (out *Flex)

SpaceStart sets the corresponding flex spacing parameter

func (*Flex) Vertical

func (f *Flex) Vertical() (out *Flex)

Vertical sets axis to vertical, otherwise it is horizontal

type Float

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

Float is for selecting a value in a range.

func (*Float) Changed

func (f *Float) Changed() bool

Changed reports whether the value has changed since the last call to Changed.

func (*Float) Fn

func (f *Float) Fn(gtx layout.Context, pointerMargin int, min, max float32) layout.Dimensions

Fn processes events.

func (*Float) Pos

func (f *Float) Pos() float32

Pos reports the selected position.

func (*Float) SetHook

func (f *Float) SetHook(fn func(fl float32)) *Float

func (*Float) SetValue

func (f *Float) SetValue(value float32) *Float

func (*Float) Value

func (f *Float) Value() float32

type Fonts

type Fonts map[string]text.Typeface

type Icon

type Icon struct {
	*Window
	// contains filtered or unexported fields
}

func (*Icon) Color

func (i *Icon) Color(color string) *Icon

Color sets the color of the icon image. It must be called before creating the image

func (*Icon) Fn

func (i *Icon) Fn(gtx l.Context) l.Dimensions

Fn renders the icon

func (*Icon) Scale

func (i *Icon) Scale(scale float32) *Icon

Scale changes the size relative to the base font size

func (*Icon) Size

func (i *Icon) Size(size unit.Value) *Icon

func (*Icon) Src

func (i *Icon) Src(data *[]byte) *Icon

Src sets the icon source to draw from

type IconButton

type IconButton struct {
	*Window
	// contains filtered or unexported fields
}

func (*IconButton) Background

func (b *IconButton) Background(color string) *IconButton

Background sets the color of the circular background

func (*IconButton) ButtonInset

func (b *IconButton) ButtonInset(inset float32) *IconButton

ButtonInset sets the size of inset that goes in between the button background and the icon

func (*IconButton) Color

func (b *IconButton) Color(color string) *IconButton

Color sets the color of the icon

func (*IconButton) Corners

func (b *IconButton) Corners(corners int) *IconButton

Corners sets the corners that will be circular

func (*IconButton) Fn

func (b *IconButton) Fn(gtx l.Context) l.Dimensions

Fn renders the icon button

func (*IconButton) Icon

func (b *IconButton) Icon(ic *Icon) *IconButton

Icon sets the icon to display

func (*IconButton) Scale

func (b *IconButton) Scale(scale float32) *IconButton

Scale changes the size of the icon as a ratio of the base font size

func (*IconButton) SetCancel

func (b *IconButton) SetCancel(fn func()) *IconButton

SetCancel sets the function to run on cancel (click but release outside)

func (*IconButton) SetClick

func (b *IconButton) SetClick(fn func()) *IconButton

SetClick sets the function to run on click

func (*IconButton) SetPress

func (b *IconButton) SetPress(fn func()) *IconButton

SetPress sets the function to run on press

type IconByColor

type IconByColor map[color.NRGBA]paint.ImageOp

type IconBySize

type IconBySize map[float32]IconByColor

type IconCache

type IconCache map[*[]byte]IconBySize

type Icons

type Icons map[string]*Icon

type Image

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

Image is a widget that displays an image.

func (Image) Fn

func (i Image) Fn(gtx layout.Context) layout.Dimensions

func (*Image) Scale

func (i *Image) Scale(scale float32) *Image

func (*Image) Src

func (i *Image) Src(img paint.ImageOp) *Image

type IncDec

type IncDec struct {
	*Window
	// contains filtered or unexported fields
}

func (*IncDec) Amount

func (in *IncDec) Amount(n int) *IncDec

func (*IncDec) Background

func (in *IncDec) Background(color string) *IncDec

func (*IncDec) ChangeHook

func (in *IncDec) ChangeHook(fn func(n int)) *IncDec

func (*IncDec) Color

func (in *IncDec) Color(color string) *IncDec

func (*IncDec) Fn

func (in *IncDec) Fn(gtx l.Context) l.Dimensions

func (*IncDec) GetCurrent

func (in *IncDec) GetCurrent() int

func (*IncDec) Inactive

func (in *IncDec) Inactive(color string) *IncDec

func (*IncDec) Max

func (in *IncDec) Max(max int) *IncDec

func (*IncDec) Min

func (in *IncDec) Min(min int) *IncDec

func (*IncDec) NDigits

func (in *IncDec) NDigits(nDigits int) *IncDec

func (*IncDec) Scale

func (in *IncDec) Scale(n float32) *IncDec

func (*IncDec) SetCurrent

func (in *IncDec) SetCurrent(current int) *IncDec

type Indefinite

type Indefinite struct {
	*Window
	// contains filtered or unexported fields
}

func (*Indefinite) Color

func (lo *Indefinite) Color(color string) *Indefinite

Color sets the color of the spinner

func (*Indefinite) Fn

func (lo *Indefinite) Fn(gtx l.Context) l.Dimensions

Fn renders the loader

func (*Indefinite) Scale

func (lo *Indefinite) Scale(scale float32) *Indefinite

Scale sets the size of the spinner

type Input

type Input struct {
	*Window

	GetText      func() string
	SetText      func(string)
	SetPasteFunc func() bool
	// contains filtered or unexported fields
}

func (*Input) Fn

func (in *Input) Fn(gtx l.Context) l.Dimensions

Fn renders the input widget

type Inset

type Inset struct {
	*Window
	// contains filtered or unexported fields
}

func (*Inset) Embed

func (in *Inset) Embed(w l.Widget) *Inset

Embed sets the widget that will be inside the inset

func (*Inset) Fn

func (in *Inset) Fn(c l.Context) l.Dimensions

Fn lays out the given widget with the configured context and padding

type IntSlider

type IntSlider struct {
	*Window
	// contains filtered or unexported fields
}

func (*IntSlider) Fn

func (i *IntSlider) Fn(gtx l.Context) l.Dimensions

func (*IntSlider) GetValue

func (i *IntSlider) GetValue() int

func (*IntSlider) Hook

func (i *IntSlider) Hook(fn func(v int)) *IntSlider

func (*IntSlider) Max

func (i *IntSlider) Max(max float32) *IntSlider

func (*IntSlider) Min

func (i *IntSlider) Min(min float32) *IntSlider

func (*IntSlider) Value

func (i *IntSlider) Value(value int) *IntSlider

type Label

type Label struct {
	*Window
	// contains filtered or unexported fields
}

func (*Label) Alignment

func (l *Label) Alignment(alignment text.Alignment) *Label

Alignment sets the text alignment, left, right or centered

func (*Label) Color

func (l *Label) Color(color string) *Label

Color sets the color of the label font

func (*Label) Fn

func (l *Label) Fn(gtx l.Context) l.Dimensions

Fn renders the label as specified

func (*Label) Font

func (l *Label) Font(font string) *Label

Font sets the font out of the available font collection

func (*Label) MaxLines

func (l *Label) MaxLines(maxLines int) *Label

MaxLines sets the maximum number of lines to render

func (*Label) Text

func (l *Label) Text(text string) *Label

Text sets the text to render in the label

func (*Label) TextScale

func (l *Label) TextScale(scale float32) *Label

TextScale sets the size of the text relative to the base font size

type List

type List struct {
	*Window
	// contains filtered or unexported fields
}

List displays a subsection of a potentially infinitely large underlying list. List accepts user input to scroll the subsection.

func (*List) Active

func (li *List) Active(color string) *List

func (*List) Background

func (li *List) Background(color string) *List

func (*List) Baseline

func (li *List) Baseline() *List

func (*List) Color

func (li *List) Color(color string) *List

func (*List) DisableScroll

func (li *List) DisableScroll(disable bool) *List

func (*List) Dragging

func (li *List) Dragging() bool

Dragging reports whether the List is being dragged.

func (*List) End

func (li *List) End() *List

func (*List) Fn

func (li *List) Fn(gtx l.Context) l.Dimensions

Fn runs the layout in the configured context. The ListElement function returns the widget at the given index

func (*List) JumpToEnd

func (li *List) JumpToEnd()

func (*List) JumpToStart

func (li *List) JumpToStart()

func (*List) Layout

func (li *List) Layout(gtx l.Context, len int, w ListElement) l.Dimensions

Layout the List.

func (*List) LeftSide

func (li *List) LeftSide(b bool) (out *List)

func (*List) Length

func (li *List) Length(length int) *List

func (*List) ListElement

func (li *List) ListElement(w ListElement) *List

func (*List) Middle

func (li *List) Middle() *List

func (*List) Position

func (li *List) Position() Position

func (*List) ScrollToEnd

func (li *List) ScrollToEnd() (out *List)

ScrollToEnd sets the List to add new items to the end and push older ones up/left and initial render has scroll to the end (or bottom) of the List

func (*List) ScrollWidth

func (li *List) ScrollWidth(width int) *List

func (*List) SetPosition

func (li *List) SetPosition(position Position)

func (*List) Slice

func (li *List) Slice(gtx l.Context, widgets ...l.Widget) l.Widget

func (*List) Start

func (li *List) Start() *List

func (*List) Vertical

func (li *List) Vertical() (out *List)

Vertical sets the axis to vertical (default implicit is horizontal)

type ListElement

type ListElement func(gtx l.Context, index int) l.Dimensions

ListElement is a function that computes the dimensions of a list element.

type Multi

type Multi struct {
	*Window
	// contains filtered or unexported fields
}

func (*Multi) Fn

func (m *Multi) Fn(gtx l.Context) l.Dimensions

func (*Multi) PopulateWidgets

func (m *Multi) PopulateWidgets() *Multi

func (*Multi) UpdateWidgets

func (m *Multi) UpdateWidgets() *Multi

func (*Multi) Widgets

func (m *Multi) Widgets() (widgets []l.Widget)

type Password

type Password struct {
	*Window
	// contains filtered or unexported fields
}

func (*Password) Blur

func (p *Password) Blur()

func (*Password) Fn

func (p *Password) Fn(gtx l.Context) l.Dimensions

func (*Password) Focus

func (p *Password) Focus()

func (*Password) GetPassword

func (p *Password) GetPassword() string

func (*Password) Hide

func (p *Password) Hide()

func (*Password) Show

func (p *Password) Show()

func (*Password) Wipe

func (p *Password) Wipe()

type Pool

type Pool struct {
	*Window
	// contains filtered or unexported fields
}

func (*Pool) FreeBool

func (p *Pool) FreeBool(b *Bool)

func (*Pool) FreeCheckable

func (p *Pool) FreeCheckable(b *Checkable)

func (*Pool) FreeClickable

func (p *Pool) FreeClickable(b *Clickable)

func (*Pool) FreeEditor

func (p *Pool) FreeEditor(b *Editor)

func (*Pool) FreeIncDec

func (p *Pool) FreeIncDec(b *IncDec)

func (*Pool) FreeList

func (p *Pool) FreeList(b *List)

func (*Pool) GetBool

func (p *Pool) GetBool() (out *Bool)

func (*Pool) GetCheckable

func (p *Pool) GetCheckable() (out *Checkable)

func (*Pool) GetClickable

func (p *Pool) GetClickable() (out *Clickable)

func (*Pool) GetEditor

func (p *Pool) GetEditor() (out *Editor)

func (*Pool) GetIncDec

func (p *Pool) GetIncDec() (out *IncDec)

func (*Pool) GetList

func (p *Pool) GetList() (out *List)

func (*Pool) Reset

func (p *Pool) Reset()

type Position

type Position struct {
	// BeforeEnd tracks whether the List position is before the very end. We use "before end" instead of "at end" so
	// that the zero value of a Position struct is useful.
	//
	// When laying out a list, if ScrollToEnd is true and BeforeEnd is false, then First and Offset are ignored, and the
	// list is drawn with the last item at the bottom. If ScrollToEnd is false then BeforeEnd is ignored.
	BeforeEnd bool
	// First is the index of the first visible child.
	First int
	// Offset is the distance in pixels from the top edge to the child at index First.
	Offset int
}

Position is a List scroll offset represented as an offset from the top edge of a child element.

type ProgressBar

type ProgressBar struct {
	*Window
	// contains filtered or unexported fields
}

func (*ProgressBar) Color

func (p *ProgressBar) Color(c string) *ProgressBar

Color sets the color to render the bar in

func (*ProgressBar) Fn

func (p *ProgressBar) Fn(gtx l.Context) l.Dimensions

Fn renders the progress bar as it is currently configured

func (*ProgressBar) SetProgress

func (p *ProgressBar) SetProgress(progress int) *ProgressBar

SetProgress sets the progress of the progress bar

type RadioButton

type RadioButton struct {
	*Checkable
	*Window
	// contains filtered or unexported fields
}

func (RadioButton) Fn

Fn updates enum and displays the radio button.

func (*RadioButton) Group

func (r *RadioButton) Group(group *Enum) *RadioButton

Group sets the enum group of the radio button

func (*RadioButton) Key

func (r *RadioButton) Key(key string) *RadioButton

Key sets the key initially active on the radiobutton

type Responsive

type Responsive struct {
	*Theme
	Widgets
	// contains filtered or unexported fields
}

func (*Responsive) Fn

func (r *Responsive) Fn(gtx l.Context) l.Dimensions

type Rows

type Rows []ColumnRow

type ScaleType

type ScaleType map[string]float32

type Slider

type Slider struct {
	*Window
	// contains filtered or unexported fields
}

func (*Slider) Color

func (s *Slider) Color(color string) *Slider

Color sets the color to draw the slider in

func (*Slider) Float

func (s *Slider) Float(f *Float) *Slider

Float sets the initial value

func (*Slider) Fn

func (s *Slider) Fn(gtx l.Context) l.Dimensions

Fn renders the slider

func (*Slider) Max

func (s *Slider) Max(max float32) *Slider

Max sets the value at the right hand side

func (*Slider) Min

func (s *Slider) Min(min float32) *Slider

Min sets the value at the left hand side

type Stack

type Stack struct {
	*l.Stack
	// contains filtered or unexported fields
}

func (*Stack) Alignment

func (s *Stack) Alignment(alignment l.Direction) *Stack

func (*Stack) Expanded

func (s *Stack) Expanded(w l.Widget) (out *Stack)

Expanded lays out a widget with the same max constraints as the stack

func (*Stack) Fn

func (s *Stack) Fn(c l.Context) l.Dimensions

Fn runs the ops queue configured in the stack

func (*Stack) Stacked

func (s *Stack) Stacked(w l.Widget) (out *Stack)

Stacked appends a widget to the stack, the stack's dimensions will be computed from the largest widget in the stack

type SubmitEvent

type SubmitEvent struct {
	Text string
}

A SubmitEvent is generated when submit is set and a carriage return key is pressed.

type Switch

type Switch struct {
	*Window
	// contains filtered or unexported fields
}

func (*Switch) DisabledColor

func (s *Switch) DisabledColor(color string) *Switch

DisabledColor sets the color to draw for the disabled state

func (*Switch) EnabledColor

func (s *Switch) EnabledColor(color string) *Switch

EnabledColor sets the color to draw for the enabled state

func (*Switch) Fn

func (s *Switch) Fn(gtx l.Context) l.Dimensions

Fn updates the switch and displays it.

func (*Switch) SetHook

func (s *Switch) SetHook(fn func(b bool)) *Switch

type Table

type Table struct {
	*Window

	Y, X []int
	// contains filtered or unexported fields
}

Table is a super simple table widget that finds the dimensions of all cells, sets all to max of each axis, and then scales the remaining space evenly

func (*Table) Body

func (t *Table) Body(g CellGrid) *Table

func (*Table) CellBackground

func (t *Table) CellBackground(color string) *Table

func (*Table) Fn

func (t *Table) Fn(gtx l.Context) l.Dimensions

func (*Table) Header

func (t *Table) Header(h CellRow) *Table

func (*Table) HeaderBackground

func (t *Table) HeaderBackground(color string) *Table

func (*Table) SetReverse

func (t *Table) SetReverse(color string) *Table

type Text

type Text struct {
	*Window
	// contains filtered or unexported fields
}

Text is a widget for laying out and drawing text.

func (*Text) Alignment

func (t *Text) Alignment(alignment text.Alignment) *Text

Alignment sets the alignment for the text

func (*Text) Fn

func (t *Text) Fn(gtx layout.Context, s text.Shaper, font text.Font, size unit.Value, txt string) layout.Dimensions

func (*Text) MaxLines

func (t *Text) MaxLines(maxLines int) *Text

MaxLines sets the alignment for the text

type TextInput

type TextInput struct {
	*Window
	// contains filtered or unexported fields
}

func (*TextInput) Color

func (e *TextInput) Color(color string) *TextInput

Color sets the color to render the text

func (*TextInput) Fn

func (e *TextInput) Fn(c l.Context) l.Dimensions

Fn renders the text input widget

func (*TextInput) Font

func (e *TextInput) Font(font string) *TextInput

Font sets the font for the text input widget

func (*TextInput) Hint

func (e *TextInput) Hint(hint string) *TextInput

Hint sets the text to show when the box is empty

func (*TextInput) HintColor

func (e *TextInput) HintColor(color string) *TextInput

HintColor sets the color of the hint text

func (*TextInput) TextScale

func (e *TextInput) TextScale(scale float32) *TextInput

TextScale sets the size of the text relative to the base font size

type TextTable

type TextTable struct {
	*Window
	Header           TextTableHeader
	Body             TextTableBody
	HeaderColor      string
	HeaderDarkTheme  bool
	HeaderBackground string
	HeaderFont       string
	HeaderFontScale  float32
	CellColor        string
	CellBackground   string
	CellFont         string
	CellFontScale    float32
	CellInset        float32
	List             *List
	Table            *Table
}

TextTable is a widget that renders a scrolling list of rows of data labeled by a header. Note that for the reasons of expedience and performance this widget assumes a growing but immutable list of rows of items. If this is used on data that is not immutable, nilling the body will cause it to be wholly regenerated, updating older content than the longest length the list has reached.

func (*TextTable) Fn

func (tt *TextTable) Fn(gtx l.Context) l.Dimensions

func (*TextTable) Regenerate

func (tt *TextTable) Regenerate(fully bool)

Regenerate the text table.

func (*TextTable) SetDefaults

func (tt *TextTable) SetDefaults() *TextTable

func (*TextTable) SetReverse

func (tt *TextTable) SetReverse() *TextTable

type TextTableBody

type TextTableBody []TextTableRow

type TextTableHeader

type TextTableHeader []string

type TextTableRow

type TextTableRow []string

type Theme

type Theme struct {
	TextSize unit.Value
	*Colors

	Dark *bool

	WidgetPool *Pool
	// contains filtered or unexported fields
}

func NewTheme

func NewTheme(fontCollection []text.FontFace, quit qu.C) (th *Theme)

NewTheme creates a new theme to use for rendering a user interface

func (*Theme) Flex

func (th *Theme) Flex() (out *Flex)

Flex creates a new flex layout

func (*Theme) Float

func (th *Theme) Float() *Float

func (*Theme) Image

func (th *Theme) Image() *Image

func (*Theme) Responsive

func (th *Theme) Responsive(size int, widgets Widgets) *Responsive

func (*Theme) SliceToWidget

func (th *Theme) SliceToWidget(w []l.Widget, axis l.Axis) l.Widget

func (*Theme) VFlex

func (th *Theme) VFlex() (out *Flex)

VFlex creates a new vertical flex layout

type WidgetMap

type WidgetMap map[string]l.Widget

type WidgetSize

type WidgetSize struct {
	Size   float32
	Widget l.Widget
}

WidgetSize is a widget with a specification of the minimum size to select it for viewing. Note that the widgets you put in here should be wrapped in func(l.Context) l.Dimensions otherwise any parameters retrieved from the controlling state variable will be from initialization and not at execution of the widget in the render process

type Widgets

type Widgets []WidgetSize

func (Widgets) Len

func (w Widgets) Len() int

func (Widgets) Less

func (w Widgets) Less(i, j int) bool

func (Widgets) Swap

func (w Widgets) Swap(i, j int)

type Window

type Window struct {
	*Theme
	*app.Window

	Width  int // stores the width at the beginning of render
	Height int

	Runner CallbackQueue
	// contains filtered or unexported fields
}

func NewWindow

func NewWindow(th *Theme) (out *Window)

NewWindow creates a new window

func NewWindowP9

func NewWindowP9(quit chan struct{}) (out *Window)

NewWindowP9 creates a new window

func (*Window) App

func (w *Window) App(size *int, activePage *uberatomic.String, invalidate chan struct{}, Break1 float32) *App

func (*Window) Body1

func (w *Window) Body1(txt string) (l *Label)

func (*Window) Body2

func (w *Window) Body2(txt string) (l *Label)

func (*Window) Bool

func (w *Window) Bool(value bool) *Bool

Bool creates a new boolean widget

func (*Window) Border

func (w *Window) Border() *Border

Border creates a border with configurable color, width and corner radius.

func (*Window) Button

func (w *Window) Button(btn *Clickable) *Button

Button is a regular material text button where all the dimensions, colors, corners and font can be changed

func (*Window) ButtonLayout

func (w *Window) ButtonLayout(button *Clickable) *ButtonLayout

ButtonLayout creates a button with a background and another widget over top

func (*Window) Caption

func (w *Window) Caption(txt string) (l *Label)

func (*Window) Card

func (w *Window) Card(background string, embed l.Widget,
) func(gtx l.Context) l.Dimensions

func (*Window) CardContent

func (w *Window) CardContent(title, color string, embed l.Widget) func(gtx l.Context) l.Dimensions

func (*Window) CardList

func (w *Window) CardList(list *List, background string,
	widgets ...l.Widget) func(gtx l.Context) l.Dimensions

func (*Window) CheckBox

func (w *Window) CheckBox(checkBox *Bool) *Checkbox

CheckBox creates a checkbox with a text label

func (*Window) Checkable

func (w *Window) Checkable() *Checkable

Checkable creates a checkbox type widget

func (*Window) Clickable

func (w *Window) Clickable() (c *Clickable)

func (*Window) Column

func (w *Window) Column(rows Rows, font string, scale float32, color string,
	background string) *Column

func (*Window) Direction

func (w *Window) Direction() (out *Direction)

Direction creates a directional layout that sets its contents to align according to the configured direction (8 cardinal directions and centered)

func (*Window) Editor

func (w *Window) Editor() *Editor

func (*Window) Enum

func (w *Window) Enum() *Enum

func (*Window) Fill

func (w *Window) Fill(col string, dxn l.Direction, radius float32, corners int, embed l.Widget) *Filler

Fill fills underneath a widget you can put over top of it, dxn sets which direction to place a smaller object, cardinal axes and center

func (*Window) H1

func (w *Window) H1(txt string) (l *Label)

func (*Window) H2

func (w *Window) H2(txt string) (l *Label)

func (*Window) H3

func (w *Window) H3(txt string) (l *Label)

func (*Window) H4

func (w *Window) H4(txt string) (l *Label)

func (*Window) H5

func (w *Window) H5(txt string) (l *Label)

func (*Window) H6

func (w *Window) H6(txt string) (l *Label)

func (*Window) Icon

func (w *Window) Icon() *Icon

Icon returns a new Icon from iconVG data.

func (*Window) IconButton

func (w *Window) IconButton(button *Clickable) *IconButton

IconButton creates an icon with a circular *optional non-round corners* background and an icon placed in the centre

func (*Window) IncDec

func (w *Window) IncDec() (out *IncDec)

IncDec is a simple increment/decrement for a number setting

func (*Window) Indefinite

func (w *Window) Indefinite() *Indefinite

Indefinite creates an indefinite loading animation icon

func (*Window) Input

func (w *Window) Input(txt, hint, borderColorFocused, borderColorUnfocused,
	backgroundColor string, handle func(txt string)) *Input

func (*Window) Inset

func (w *Window) Inset(pad float32, embed l.Widget) (out *Inset)

Inset creates a padded empty space around a widget

func (*Window) IntSlider

func (w *Window) IntSlider() *IntSlider

func (*Window) Label

func (w *Window) Label() (l *Label)

Label creates a label that prints a block of text

func (*Window) List

func (w *Window) List() (li *List)

List returns a new scrollable List widget

func (*Window) Multiline

func (w *Window) Multiline(
	txt *cli.StringSlice,
	borderColorFocused, borderColorUnfocused, backgroundColor string,
	size float32,
	handle func(txt []string),
) (m *Multi)

func (*Window) NewPool

func (w *Window) NewPool() *Pool

func (*Window) Open

func (w *Window) Open() (out *Window)

Open sets the window options and initialise the app.window

func (*Window) Overlay

func (w *Window) Overlay(gtx l.Context)

func (*Window) Password

func (w *Window) Password(
	hint string, password *string, borderColorFocused,
	borderColorUnfocused, backgroundColor string, handle func(pass string),
) *Password

func (*Window) PopOverlay

func (w *Window) PopOverlay()

func (*Window) ProgressBar

func (w *Window) ProgressBar() *ProgressBar

ProgressBar renders a horizontal bar with an indication of completion of a process

func (*Window) PushOverlay

func (w *Window) PushOverlay(overlay func(gtx l.Context))

func (*Window) RadioButton

func (w *Window) RadioButton(checkable *Checkable, group *Enum, key,
	label string) *RadioButton

RadioButton returns a RadioButton with a label. The key specifies the value for the Enum.

func (*Window) Run

func (w *Window) Run(frame func(ctx l.Context) l.Dimensions,
	overlay func(ctx l.Context), destroy func(), quit qu.C) (err error)

func (*Window) Scale

func (w *Window) Scale(s float32) *Window

Scale sets the scale factor for rendering

func (*Window) Size

func (w *Window) Size(width, height float32) (out *Window)

Size sets the dimensions of the window

func (*Window) Slider

func (w *Window) Slider() *Slider

Slider is for selecting a value in a range.

func (*Window) Stack

func (w *Window) Stack() (out *Stack)

Stack starts a chain of widgets to compose into a stack

func (*Window) Switch

func (w *Window) Switch(swtch *Bool) *Switch

Switch creates a boolean switch widget (basically a checkbox but looks like a switch)

func (*Window) Table

func (w *Window) Table() *Table

func (*Window) Text

func (w *Window) Text() *Text

func (*Window) TextInput

func (w *Window) TextInput(editor *Editor, hint string) *TextInput

TextInput creates a simple text input widget

func (*Window) Title

func (w *Window) Title(title string) (out *Window)

Title sets the title of the window

Jump to

Keyboard shortcuts

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