wid

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT, Unlicense Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const GridBorderWidth = 0.0

Variables

View Source
var (
	StateMap      = make(map[any]*EditState)
	StateMapMutex sync.RWMutex
)
View Source
var C = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 2, R: 1, B: 1},
	FontNo:  gpu.Normal12,
	Align:   AlignCenter,
	Role:    theme.OnSurface,
}
View Source
var CheckBoxHeader = &BtnStyle{
	FontNo:        gpu.Normal12,
	InsidePadding: f32.Padding{L: 1, T: 1, R: 1, B: 1},
	BtnRole:       theme.PrimaryContainer,
	BorderColor:   theme.Outline,
	BorderWidth:   GridBorderWidth,
	IconPad:       3,
	IconSize:      0.75,
}
View Source
var ComboStateMap = make(map[any]*ComboState)
View Source
var ContStyle = &ContainerStyle{
	BorderRole:     theme.Transparent,
	BorderWidth:    0.0,
	Role:           theme.Transparent,
	CornerRadius:   0.0,
	InsidePadding:  f32.Padding{},
	OutsidePadding: f32.Padding{L: 2, T: 2, R: 2, B: 2},
}
View Source
var DebugWidgets = flag.Bool("debug", false, "Set to debug widgets and write font info")

DebugWidgets is the flag set by command line argument -debug. Many widgets will then draw rectangles around their components (label/value).

View Source
var DefImg = &ImgStyle{
	Width:          0,
	Height:         0,
	OutsidePadding: f32.Padding{L: 5, T: 5, R: 5, B: 5},
	BorderRole:     theme.Outline,
	SurfaceRole:    theme.Surface,
	BorderWidth:    1.0,
	CornerRadius:   4.0,
	Scaling:        FitAll,
	Align:          AlignCenter,
}
View Source
var DefMemo = &MemoStyle{
	ScrollStyle:    DefaultScrollStyle,
	InsidePadding:  f32.Padding{L: 2, T: 2, R: 1, B: 2},
	OutsidePadding: f32.Padding{L: 5, T: 3, R: 4, B: 3},
	Height:         0.5,
	FontNo:         gpu.Mono12,
	FontSize:       0.9,
	Color:          theme.OnSurface,
	BorderRole:     theme.Outline,
	BorderWidth:    1.0,
	CornerRadius:   0.0,
	Wrap:           true,
}
View Source
var DefaultCb = CbStyle{
	FontNo:  gpu.Normal12,
	Role:    theme.OnSurface,
	Padding: f32.Padding{L: 3, T: 1, R: 2, B: 1},
}
View Source
var DefaultCheckbox = CbStyle{
	FontNo:  gpu.Normal12,
	Role:    theme.OnSurface,
	Padding: f32.Padding{L: 3, T: 1, R: 2, B: 1},
}
View Source
var DefaultCombo = ComboStyle{
	EditStyle: EditStyle{
		FontNo:             gpu.Normal12,
		Color:              theme.Surface,
		BorderColor:        theme.Outline,
		OutsidePadding:     f32.Padding{L: 2, T: 2, R: 2, B: 2},
		InsidePadding:      f32.Padding{L: 2, T: 2, R: 2, B: 2},
		BorderWidth:        1,
		BorderCornerRadius: 4,
		CursorWidth:        2,
		EditSize:           0.0,
		LabelSize:          0.0,
		LabelRightAdjust:   true,
		LabelSpacing:       2,
	},
	MaxDropDown: 10,
	NotEditable: false,
}
View Source
var DefaultEdit = EditStyle{
	FontNo:             gpu.Normal12,
	Color:              theme.Surface,
	BorderColor:        theme.Outline,
	OutsidePadding:     f32.Padding{L: 2, T: 2, R: 2, B: 2},
	InsidePadding:      f32.Padding{L: 2, T: 2, R: 2, B: 2},
	BorderWidth:        1,
	BorderCornerRadius: 4,
	CursorWidth:        2,
	EditSize:           0.0,
	LabelSize:          0.0,
	LabelRightAdjust:   true,
	LabelSpacing:       2,
	Dp:                 2,
}
View Source
var DefaultHintStyle = HintStyle{
	FontNo:       gpu.Normal10,
	FontSize:     0.9,
	Color:        theme.SecondaryContainer,
	CornerRadius: 5,
	BorderColor:  theme.Outline,
	BorderWidth:  1,
	Padding:      f32.Padding{L: 3, T: 3, R: 3, B: 2},
	Delay:        time.Millisecond * 1500,
}
View Source
var DefaultLabel = LabelStyle{
	Padding: f32.Padding{L: 2, T: 2, R: 1, B: 1},
	FontNo:  gpu.Normal12,
	Role:    theme.OnSurface,
}
View Source
var DefaultRadioButton = CbStyle{
	FontNo:  gpu.Normal12,
	Role:    theme.OnSurface,
	Padding: f32.Padding{L: 3, T: 1, R: 2, B: 1},
}
View Source
var DefaultResizer = ResizerStyle{Width: 2, Role: theme.OnSurface}
View Source
var DefaultScrollStyle = ScrollStyle{
	Width:             0.5,
	ScrollbarWidth:    10.0,
	MinThumbHeight:    15.0,
	TrackAlpha:        0.15,
	NormalAlpha:       0.4,
	HoverAlpha:        0.8,
	ScrollerMargin:    1.0,
	ThumbCornerRadius: 3.0,
	ScrollFactor:      0.2,
}
View Source
var DefaultSwitchStyle = &SwitchStyle{

	Padding:         f32.Padding{L: 3, T: 1, R: 2, B: 1},
	ShadowSize:      4,
	BorderThickness: 1.0,
	Track:           theme.Surface,
	Knob:            theme.Outline,
	On:              theme.Primary,
	FontNo:          gpu.Normal12,
}
View Source
var DropdownScrollerStyle = ScrollStyle{
	Width:             0.5,
	ScrollbarWidth:    8.0,
	MinThumbHeight:    10.0,
	TrackAlpha:        0.15,
	NormalAlpha:       0.4,
	HoverAlpha:        0.8,
	ScrollerMargin:    1.0,
	ThumbCornerRadius: 3.0,
	ScrollFactor:      0.2,
}
View Source
var Filled = &BtnStyle{
	FontNo:         gpu.Normal14,
	BtnRole:        theme.Primary,
	BorderColor:    theme.Primary,
	OutsidePadding: f32.Padding{L: 4, T: 4, R: 4, B: 4},
	InsidePadding:  f32.Padding{L: 12, T: 5, R: 12, B: 5},
	BorderWidth:    0,
	CornerRadius:   6,
	IconPad:        0,
	IconSize:       1.3,
}
View Source
var GridCheckBox = CbStyle{
	FontNo:          gpu.Normal12,
	Role:            theme.PrimaryContainer,
	Padding:         f32.Padding{L: 1, T: 1, R: 1, B: 1},
	BorderThickness: 0.0,
}
View Source
var GridCombo = ComboStyle{
	EditStyle:   GridEdit,
	MaxDropDown: 10,
	NotEditable: true,
}
View Source
var GridEdit = EditStyle{
	FontNo:        gpu.Normal12,
	EditSize:      1.0,
	Color:         theme.PrimaryContainer,
	BorderColor:   theme.Transparent,
	InsidePadding: f32.Padding{L: 2, T: 1, R: 2, B: 1},
	CursorWidth:   1,
	BorderWidth:   GridBorderWidth,
	Dp:            2,
}
View Source
var GridStyle = ContainerStyle{
	BorderRole:   theme.Outline,
	BorderWidth:  0.5,
	Role:         theme.Surface,
	CornerRadius: 0.0,
	HasGrid:      true,
}
View Source
var H1C = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold20,
	Role:    theme.OnSurface,
	Align:   AlignCenter,
}
View Source
var H1L = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold20,
	Role:    theme.OnSurface,
	Align:   AlignLeft,
}
View Source
var H1R = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold20,
	Role:    theme.OnSurface,
	Align:   AlignRight,
}
View Source
var H2C = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold16,
	Role:    theme.OnSurface,
	Align:   AlignCenter,
}
View Source
var H2L = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold16,
	Role:    theme.OnSurface,
	Align:   AlignLeft,
}
View Source
var H2R = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 3, R: 1, B: 2},
	FontNo:  gpu.Bold16,
	Role:    theme.OnSurface,
	Align:   AlignRight,
}
View Source
var Header = &BtnStyle{
	FontNo:        gpu.Normal12,
	InsidePadding: f32.Padding{L: 2, T: 1, R: 2, B: 1},
	BtnRole:       theme.Transparent,

	Width:    0.3,
	IconPad:  3,
	IconSize: 0.65,
}
View Source
var I = &LabelStyle{
	Padding: f32.Padding{L: 5, T: 3, R: 1, B: 2},
	FontNo:  gpu.Italic12,
	Role:    theme.OnSurface,
}
View Source
var L = &LabelStyle{
	Padding: f32.Padding{L: 2, T: 2, R: 1, B: 1},
	FontNo:  gpu.Normal12,
	Role:    theme.OnSurface,
}
View Source
var MemoStateMap = make(map[any]*ScrollState)
View Source
var Outline = &BtnStyle{
	FontNo:         gpu.Normal14,
	BtnRole:        theme.Transparent,
	BorderColor:    theme.Outline,
	OutsidePadding: f32.Padding{L: 5, T: 5, R: 5, B: 5},
	InsidePadding:  f32.Padding{L: 5, T: 5, R: 5, B: 7},
	BorderWidth:    1,
	CornerRadius:   6,
	IconPad:        1,
	IconSize:       1.3,
}
View Source
var Primary = ContainerStyle{
	BorderRole:     theme.Outline,
	BorderWidth:    1,
	Role:           theme.PrimaryContainer,
	CornerRadius:   0.0,
	InsidePadding:  f32.Padding{L: 2, T: 2, R: 2, B: 2},
	OutsidePadding: f32.Padding{L: 2, T: 2, R: 2, B: 2},
}
View Source
var ProgressStyle = ContainerStyle{
	BorderRole:     theme.Outline,
	BorderWidth:    1,
	Role:           theme.PrimaryContainer,
	CornerRadius:   2.0,
	InsidePadding:  f32.Padding{L: 2, T: 1, R: 2, B: 1},
	OutsidePadding: f32.Padding{L: 2, T: 2, R: 2, B: 2},
	Height:         16,
}
View Source
var Round = &BtnStyle{
	FontNo:         gpu.Normal14,
	BtnRole:        theme.Primary,
	BorderColor:    theme.Transparent,
	OutsidePadding: f32.Padding{L: 5, T: 5, R: 5, B: 5},
	InsidePadding:  f32.Padding{L: 6, T: 6, R: 6, B: 6},
	BorderWidth:    0,

	CornerRadius: -1,
	IconSize:     1.3,
}
View Source
var Secondary = ContainerStyle{
	BorderRole:     theme.Outline,
	BorderWidth:    0,
	Role:           theme.SecondaryContainer,
	CornerRadius:   9.0,
	InsidePadding:  f32.Padding{L: 4, T: 4, R: 4, B: 4},
	OutsidePadding: f32.Padding{L: 4, T: 4, R: 4, B: 4},
}
View Source
var Text = &BtnStyle{
	FontNo:         gpu.Normal14,
	BtnRole:        theme.Transparent,
	BorderColor:    theme.Transparent,
	OutsidePadding: f32.Padding{L: 5, T: 5, R: 5, B: 5},
	InsidePadding:  f32.Padding{L: 5, T: 5, R: 5, B: 7},
	BorderWidth:    0,
	CornerRadius:   6,
	IconPad:        1,
	IconSize:       1.3,
}

Functions

func CalculateRects

func CalculateRects(hasLabel bool, style *EditStyle, r f32.Rect) (dim, frameRect, valueRect, labelRect f32.Rect)

CalculateRects returns frameRect, valueRect, labelRect based on available space in r

func ClearBuffers

func ClearBuffers()

func Default added in v0.2.0

func Default[T any](ptr **T, def *T)

func Display

func Display(win *sys.Window, x, y, w float32, widget Wid)

Display is used to paint a given widget directly to the screen at given coordinates. Skipping all layout functions.

func Draw

func Draw(Gd *gpu.GlData, x, y, w float32, h float32, img *Img)

Draw will paint the image to the screen, and scale it

func DrawCursor

func DrawCursor(ctx Ctx, style *EditStyle, state *EditState, valueRect f32.Rect, f *font.Font)

func DrawDebuggingInfo

func DrawDebuggingInfo(ctx Ctx, labelRect f32.Rect, valueRect f32.Rect, WidgetRect f32.Rect)

func DrawVertScrollbar

func DrawVertScrollbar(ctx Ctx, state *ScrollState, style *ScrollStyle)

DrawVertScrollbar will draw a bar at the right edge of the area r. state.Ypos is the position. (Ymax-Yvis) is max Ypos. Yvis is the visible part

func EditMouseHandler

func EditMouseHandler(ctx Ctx, state *EditState, valueRect f32.Rect, f *font.Font, value any)

func EditText

func EditText(ctx Ctx, state *EditState, action func())

func Hint

func Hint(ctx Ctx, text string, tag any)

Hint should be called if the mouse is inside a widget with a hint i.e. when it is hovered.

func IsKeyClick added in v0.3.0

func IsKeyClick(ctx Ctx) bool

func Show

func Show(w Wid)

Show is used to display a form consisting of a widget. Typically, the widget is a column or a scroller.

func VertScollbarUserInput

func VertScollbarUserInput(ctx Ctx, state *ScrollState, style *ScrollStyle)

VertScollbarUserInput will draw a bar at the right edge of the area r.

Types

type Alignment

type Alignment int
const (
	AlignLeft Alignment = iota
	AlignRight
	AlignCenter
)

type BtnStyle

type BtnStyle struct {
	FontNo         int
	BtnRole        theme.UIRole
	BorderColor    theme.UIRole
	BorderWidth    float32
	CornerRadius   float32
	InsidePadding  f32.Padding
	OutsidePadding f32.Padding
	Disabler       *bool
	IconPad        float32
	IconSize       float32
	Width          float32
}

func (*BtnStyle) Disabled

func (s *BtnStyle) Disabled() bool

func (*BtnStyle) Font

func (s *BtnStyle) Font(n int) *BtnStyle

func (*BtnStyle) Pad

func (s *BtnStyle) Pad(p float32) *BtnStyle

func (*BtnStyle) RR

func (s *BtnStyle) RR(r float32) *BtnStyle

func (*BtnStyle) Role

func (s *BtnStyle) Role(c theme.UIRole) *BtnStyle

func (*BtnStyle) W

func (s *BtnStyle) W(w float32) *BtnStyle

type CachedScrollState added in v0.5.0

type CachedScrollState struct {
	ScrollState
	// contains filtered or unexported fields
}

CachedScrollState is a ScrollState with additional data to implement a cache of widgets.

type CbStyle added in v0.3.0

type CbStyle struct {
	FontNo          int
	Role            theme.UIRole
	Padding         f32.Padding
	BorderThickness float32
}

type ComboState

type ComboState struct {
	EditState
	ScrollState
	// contains filtered or unexported fields
}

type ComboStyle

type ComboStyle struct {
	EditStyle
	MaxDropDown int
	NotEditable bool
}

func (*ComboStyle) D added in v0.2.0

func (s *ComboStyle) D(f *bool) *ComboStyle

func (*ComboStyle) Pad

func (s *ComboStyle) Pad(p float32) *ComboStyle

func (*ComboStyle) Size

func (s *ComboStyle) Size(wl, we float32) *ComboStyle

type ContainerStyle

type ContainerStyle struct {
	Width          float32
	Height         float32
	BorderRole     theme.UIRole
	BorderWidth    float32
	Role           theme.UIRole
	CornerRadius   float32
	InsidePadding  f32.Padding
	OutsidePadding f32.Padding
	HasGrid        bool
}

func (*ContainerStyle) C

func (*ContainerStyle) H

func (style *ContainerStyle) H(h float32) *ContainerStyle

func (*ContainerStyle) R

func (*ContainerStyle) Size

func (style *ContainerStyle) Size(w, h, bw float32) *ContainerStyle

func (*ContainerStyle) TotalVerticalPadding added in v0.2.0

func (style *ContainerStyle) TotalVerticalPadding() float32

func (*ContainerStyle) W

func (style *ContainerStyle) W(w float32) *ContainerStyle

type Ctx

type Ctx struct {
	// Rect consists of the X,Y,W,H values. That is the size and position of the area to be drawn.
	f32.Rect
	Baseline float32
	Mode     Mode
	Win      *sys.Window
}

func NewCtx

func NewCtx(win *sys.Window) Ctx

NewCtx returns a new context with the current window size

func (Ctx) SetCursor

func (ctx Ctx) SetCursor(id int)

SetCursor will update the cursor type in the current window This new cursor will be visible on next redraw

type Dim

type Dim struct {
	W        float32
	H        float32
	Baseline float32
}

type EditState

type EditState struct {
	SelStart int
	SelEnd   int
	Buffer   utf8.String
	// contains filtered or unexported fields
}

type EditStyle

type EditStyle struct {
	FontNo             int
	Color              theme.UIRole
	BorderColor        theme.UIRole
	BorderWidth        float32
	BorderCornerRadius float32
	InsidePadding      f32.Padding
	OutsidePadding     f32.Padding
	CursorWidth        float32
	EditSize           float32
	LabelSize          float32
	LabelRightAdjust   bool
	LabelSpacing       float32
	Dp                 int
	ReadOnly           bool
	Disabler           *bool
}

func (*EditStyle) D added in v0.2.0

func (s *EditStyle) D(flag *bool) *EditStyle

func (*EditStyle) Dim

func (s *EditStyle) Dim(ctx Ctx, f *font.Font) Dim

Dim wil calculate the dimension of edit/combo/checkbox ctx.W is the maximum available space (unless it is 0)

func (*EditStyle) Disabled added in v0.3.0

func (s *EditStyle) Disabled() bool

func (*EditStyle) RO

func (s *EditStyle) RO() *EditStyle

func (*EditStyle) Size

func (s *EditStyle) Size(wl, we float32) *EditStyle

func (*EditStyle) Top

func (s *EditStyle) Top() float32

func (*EditStyle) TopPad added in v0.2.0

func (s *EditStyle) TopPad(p float32) *EditStyle

type Fit

type Fit int
const (
	FitAll Fit = iota
	FitHeight
	FitWidth
	Original
)

type HintStyle

type HintStyle struct {
	FontNo       int
	FontSize     float32
	Color        theme.UIRole
	CornerRadius float32
	BorderColor  theme.UIRole
	BorderWidth  float32
	Padding      f32.Padding
	Delay        time.Duration
}

type Img

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

func NewImage

func NewImage(filename string) (*Img, error)

NewImage generates a new image struct with the rgba image data It can later be displayed by using Draw()

func NewImageFrom

func NewImageFrom(buffer []byte) (*Img, error)

type ImgStyle

type ImgStyle struct {
	OutsidePadding f32.Padding
	BorderRole     theme.UIRole
	SurfaceRole    theme.UIRole
	BorderWidth    float32
	CornerRadius   float32
	Width          float32
	Height         float32
	Scaling        Fit
	Align          Alignment
}

func (*ImgStyle) Bg

func (b *ImgStyle) Bg(r theme.UIRole) *ImgStyle

func (*ImgStyle) H

func (b *ImgStyle) H(h float32) *ImgStyle

func (*ImgStyle) W

func (b *ImgStyle) W(w float32) *ImgStyle

type LabelStyle

type LabelStyle struct {
	Padding   f32.Padding
	FontNo    int
	Role      theme.UIRole
	Align     Alignment
	Multiline bool
	Width     float32
	Height    float32
}

func (*LabelStyle) Font

func (s *LabelStyle) Font(n int) *LabelStyle

func (*LabelStyle) R

func (s *LabelStyle) R(r theme.UIRole) *LabelStyle

func (*LabelStyle) Top

func (s *LabelStyle) Top(p float32) *LabelStyle

type MemoStyle

type MemoStyle struct {
	ScrollStyle
	Height         float32
	InsidePadding  f32.Padding
	OutsidePadding f32.Padding
	BorderRole     theme.UIRole
	BorderWidth    float32
	CornerRadius   float32
	Wrap           bool
	FontNo         int
	FontSize       float32
	Color          theme.UIRole
	Role           theme.UIRole
}

type Mode

type Mode int
const (
	RenderChildren Mode = iota
	CollectWidths
	CollectHeights
)

type ResizerState

type ResizerState struct {
	StartPos float32
	// contains filtered or unexported fields
}

type ResizerStyle

type ResizerStyle struct {
	Width float32
	Role  theme.UIRole
}

type ScrollState

type ScrollState struct {
	// Npos is the item number for the first visible widget
	// which can be only partially visible
	Npos int
	// Nmax is the total number of items
	Nmax int
	// Nlast is the number of item actually drawn/calculated, will be Nmax when all items are drawn/calculated
	Nlast int
	// Ypos is the Y position of the first pixel drawn. I.e. the amount scrolled down,
	// minimum is 0 at the top, and maximum is Ymax-VisibleHeight.
	Ypos float32
	// Ylast is the height of all items we have seen, will be equal to Ymax when all items are drawn/calculated
	Ylast float32
	// Ymax is the total height of all items
	Ymax float32
	// Dy is the offset from the top of the first item down to the visible window.
	// i.e. the height not visible.
	Dy float32
	// Dragging is a flag that is true while the mous button is down in the scrollbar
	Dragging bool
	// StartPos is the mouse position on start of dragging
	StartPos      float32
	AtEnd         bool
	Id            int
	PendingScroll float32
}

type ScrollStyle added in v0.5.0

type ScrollStyle struct {
	Height            float32
	Width             float32
	ScrollbarWidth    float32
	MinThumbHeight    float32
	TrackAlpha        float32
	NormalAlpha       float32
	HoverAlpha        float32
	ScrollerMargin    float32
	ThumbCornerRadius float32
	// ScrollFactor is the fraction of the visible area that is scrolled.
	ScrollFactor float32
}

type SwitchStyle

type SwitchStyle struct {
	// Height          float32
	Padding         f32.Padding
	ShadowSize      float32
	BorderThickness float32
	Track           theme.UIRole
	Knob            theme.UIRole
	On              theme.UIRole
	FontNo          int
}

type Wid

type Wid func(ctx Ctx) Dim

func BoxText

func BoxText(text string, fg f32.Color, bg f32.Color, style *LabelStyle) Wid

BoxText will display a colored box with colored text inside it. The text will be centered inside the box.

func Btn

func Btn(text string, ic *gpu.Icon, action func(), style *BtnStyle, hint string) Wid

func CashedScroller

func CashedScroller(state *CachedScrollState, style *ScrollStyle, f func(itemno int) Wid, n func() int) Wid

CaschedScroller is a scrollable container with vertical scrolling, it implements a cache for the elements in the container, suitable for large database tables etc.

func Checkbox

func Checkbox(label string, state *bool, action func(), style *CbStyle, hint string) Wid

func Col

func Col(style *ContainerStyle, widgets ...Wid) Wid

func Combo

func Combo(value any, list []string, label string, style *ComboStyle) Wid

func Edit

func Edit(value any, label string, action func(), style *EditStyle) Wid

func Flex added in v0.3.0

func Flex() Wid

Flex is an empty widget that takes up the remaining space after all the other widgets are drawn.

func HorResizer

func HorResizer(state *ResizerState, style *ResizerStyle, widget1 Wid, widget2 Wid) Wid

func Image

func Image(img *Img, action func(), style *ImgStyle, altText string) Wid

Image is the widget for drawing images

func Label

func Label(text string, style *LabelStyle) Wid

Label will display a possibly multilied text Padding and alignment can be specified in the style.

func Line

func Line(dx, dy float32, color theme.UIRole) Wid

Line draws a line of the given color. If dx or dy is 0, it will be the width or height of the parent.

func Memo

func Memo(text *[]string, style *MemoStyle) Wid

func ProgressBar added in v0.3.0

func ProgressBar(fraction float32, style *ContainerStyle) Wid

func RadioButton

func RadioButton(label string, value *string, key string, style *CbStyle) Wid

func Row

func Row(style *ContainerStyle, widgets ...Wid) Wid

func Scroller

func Scroller(state *ScrollState, style *ScrollStyle, widgets ...Wid) Wid

Scroller is a scrollable container (vertical scrolling only)

func Separator

func Separator(dx, dy float32) Wid

Separator draws a separator. If dx or dy is 0, it will be the width or height of the parent.

func Switch

func Switch(label string, state *bool, action func(), style *SwitchStyle, hint string) Wid

func VertResizer

func VertResizer(state *ResizerState, style *ResizerStyle, widget1 Wid, widget2 Wid) Wid

Jump to

Keyboard shortcuts

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