Versions in this module Expand all Collapse all v0 v0.15.0 Sep 3, 2026 Changes in this version + var Black = RGB(0, 0, 0) + var DefaultTheme = Theme + var Rose = Hex("#d64f8c") + var SoftRose = Hex("#f4a6c8") + var Transparent = RGBA(0, 0, 0, 0) + var White = RGB(255, 255, 255) + func Confirm(title, text string) bool + func Error(title, text string) + func Message(title, text string) + func OpenFileDialog(options FileDialogOptions) (path string, ok bool) + func Quit() + func Run(content Widget) + func RunApp(app App) + func SaveFileDialog(options FileDialogOptions) (path string, ok bool) + type AVIFOptions struct + Lossless bool + Quality int + Speed int + type Alignment uint8 + const AlignCenter + const AlignEnd + const AlignStart + const AlignStretch + type AlignmentBox struct + func Align(content Widget, horizontal, vertical Alignment) *AlignmentBox + func Center(content Widget) *AlignmentBox + type App struct + Content Widget + Height int + Menu *AppMenuBar + OnCloseRequest func() bool + OnKeyDown func(KeyEvent) + OnKeyUp func(KeyEvent) + Padding int + Shortcuts []KeyShortcut + Tasks []*Task + Theme Theme + Timers []*Timer + Title string + Width int + type AppMenu struct + func Menu(text string, entries ...MenuEntry) *AppMenu + type AppMenuBar struct + func MenuBar(menus ...*AppMenu) *AppMenuBar + type Box struct + func Column(children ...Widget) *Box + func Row(children ...Widget) *Box + func (b *Box) Expand() *Box + func (b *Box) Gap(pixels int) *Box + func (b *Box) Padding(pixels int) *Box + type ButtonWidget struct + func Button(text string, onClick func()) *ButtonWidget + func (b *ButtonWidget) Primary() *ButtonWidget + type CanvasWidget struct + func Canvas(draw func(*DrawingCanvas)) *CanvasWidget + func (c *CanvasWidget) Background(color Color) *CanvasWidget + func (c *CanvasWidget) Expand() *CanvasWidget + func (c *CanvasWidget) Focus() *CanvasWidget + func (c *CanvasWidget) OnKeyDown(handler func(KeyEvent)) *CanvasWidget + func (c *CanvasWidget) OnKeyUp(handler func(KeyEvent)) *CanvasWidget + func (c *CanvasWidget) OnMouseDown(handler func(MouseEvent)) *CanvasWidget + func (c *CanvasWidget) OnMouseMove(handler func(MouseEvent)) *CanvasWidget + func (c *CanvasWidget) OnMouseUp(handler func(MouseEvent)) *CanvasWidget + func (c *CanvasWidget) Picture() *Picture + func (c *CanvasWidget) Redraw() + func (c *CanvasWidget) Size(width, height int) *CanvasWidget + type CardWidget struct + func Card(content Widget) *CardWidget + func (c *CardWidget) Expand() *CardWidget + func (c *CardWidget) Padding(pixels int) *CardWidget + type CheckBoxWidget struct + func CheckBox(text string, value *bool) *CheckBoxWidget + func (c *CheckBoxWidget) Focus() *CheckBoxWidget + func (c *CheckBoxWidget) OnChange(handler func(bool)) *CheckBoxWidget + type Color struct + A uint8 + B uint8 + G uint8 + R uint8 + func Hex(value string) Color + func ParseHex(value string) (Color, error) + func RGB(r, g, b uint8) Color + func RGBA(r, g, b, a uint8) Color + func (c Color) String() string + type ComboBoxWidget struct + func ComboBox(value *string, options ...string) *ComboBoxWidget + func (c *ComboBoxWidget) Focus() *ComboBoxWidget + func (c *ComboBoxWidget) OnChange(handler func(string)) *ComboBoxWidget + func (c *ComboBoxWidget) Options() []string + func (c *ComboBoxWidget) Select(value string) + func (c *ComboBoxWidget) Selected() string + func (c *ComboBoxWidget) SetOptions(options ...string) + func (c *ComboBoxWidget) Width(columns int) *ComboBoxWidget + type DrawingCanvas struct + func (c *DrawingCanvas) Circle(x, y, radius, stroke float64, value Color) + func (c *DrawingCanvas) Clear(value Color) + func (c *DrawingCanvas) Clip(rect Rect) + func (c *DrawingCanvas) ClipRect(x, y, width, height float64) + func (c *DrawingCanvas) FillCircle(x, y, radius float64, value Color) + func (c *DrawingCanvas) FillPath(path *Path, value Color) + func (c *DrawingCanvas) FillRect(x, y, width, height float64, value Color) + func (c *DrawingCanvas) Line(x1, y1, x2, y2, stroke float64, value Color) + func (c *DrawingCanvas) Pop() + func (c *DrawingCanvas) Push() + func (c *DrawingCanvas) Rect(x, y, width, height, stroke float64, value Color) + func (c *DrawingCanvas) ResetClip() + func (c *DrawingCanvas) ResetTransform() + func (c *DrawingCanvas) Rotate(degrees float64) + func (c *DrawingCanvas) Scale(x, y float64) + func (c *DrawingCanvas) StrokePath(path *Path, stroke float64, value Color) + func (c *DrawingCanvas) Text(text string, x, y float64, style TextStyle) + func (c *DrawingCanvas) Translate(x, y float64) + type FileDialogOptions struct + DefaultExtension string + Filters []FileFilter + InitialDirectory string + InitialFile string + Title string + type FileFilter struct + Extensions []string + Name string + type GridLayout struct + func Grid(columns int, children ...Widget) *GridLayout + func (g *GridLayout) Expand() *GridLayout + func (g *GridLayout) Gap(pixels int) *GridLayout + func (g *GridLayout) Padding(pixels int) *GridLayout + type ImageWidget struct + func Image(picture *Picture) *ImageWidget + func (i *ImageWidget) Expand() *ImageWidget + func (i *ImageWidget) Picture() *Picture + func (i *ImageWidget) Placeholder(text string) *ImageWidget + func (i *ImageWidget) SetImage(picture *Picture) + type Key string + const KeyAlt + const KeyBackspace + const KeyCapsLock + const KeyControl + const KeyDelete + const KeyDown + const KeyEnd + const KeyEnter + const KeyEscape + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF2 + const KeyF3 + const KeyF4 + const KeyF5 + const KeyF6 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyHome + const KeyInsert + const KeyLeft + const KeyPageDown + const KeyPageUp + const KeyRight + const KeyShift + const KeySpace + const KeySuper + const KeyTab + const KeyUnknown + const KeyUp + func (k Key) String() string + type KeyEvent struct + Alt bool + Control bool + Key Key + Primary bool + Shift bool + Text string + func (e KeyEvent) Is(key Key) bool + type KeyShortcut struct + func Shortcut(keys string, onPress func()) KeyShortcut + func Shortcuts(shortcuts ...KeyShortcut) []KeyShortcut + func (s KeyShortcut) Keys() string + type LabelWidget struct + func Label(text string) *LabelWidget + func LabelFunc(text func() string) *LabelWidget + func (l *LabelWidget) Bold() *LabelWidget + func (l *LabelWidget) Color(color Color) *LabelWidget + func (l *LabelWidget) FontSize(pixels int) *LabelWidget + func (l *LabelWidget) TextAlign(alignment Alignment) *LabelWidget + type ListWidget struct + func List(items ...string) *ListWidget + func (l *ListWidget) Expand() *ListWidget + func (l *ListWidget) Items() []string + func (l *ListWidget) OnActivate(handler func(index int, value string)) *ListWidget + func (l *ListWidget) OnSelect(handler func(index int, value string)) *ListWidget + func (l *ListWidget) Select(index int) + func (l *ListWidget) Selected() (index int, value string, ok bool) + func (l *ListWidget) SetItems(items ...string) + func (l *ListWidget) Size(columns, rows int) *ListWidget + type MenuAction struct + func MenuItem(text string, onClick func()) *MenuAction + func (m *MenuAction) Shortcut(shortcut string) *MenuAction + type MenuEntry interface + func MenuSeparator() MenuEntry + type MouseButton uint8 + const MouseLeft + const MouseMiddle + const MouseNone + const MouseRight + type MouseEvent struct + Alt bool + Button MouseButton + Control bool + Dragging bool + Shift bool + X float64 + Y float64 + type Path struct + func NewPath() *Path + func (p *Path) Close() *Path + func (p *Path) CubicTo(control1X, control1Y, control2X, control2Y, x, y float64) *Path + func (p *Path) LineTo(x, y float64) *Path + func (p *Path) MoveTo(x, y float64) *Path + func (p *Path) QuadraticTo(controlX, controlY, x, y float64) *Path + type Picture struct + func LoadImage(path string) (*Picture, error) + func NewPicture(pixels image.Image) *Picture + func Render(width, height int, draw func(*DrawingCanvas)) *Picture + func (p *Picture) Format() string + func (p *Picture) Height() int + func (p *Picture) Image() image.Image + func (p *Picture) Path() string + func (p *Picture) SaveAVIF(path string, options ...AVIFOptions) error + func (p *Picture) SavePNG(path string) error + func (p *Picture) Width() int + type ProgressBarWidget struct + func ProgressBar(value *float64) *ProgressBarWidget + func (p *ProgressBarWidget) Busy() *ProgressBarWidget + func (p *ProgressBarWidget) Determinate() *ProgressBarWidget + func (p *ProgressBarWidget) Horizontal() *ProgressBarWidget + func (p *ProgressBarWidget) IsBusy() bool + func (p *ProgressBarWidget) Length(pixels int) *ProgressBarWidget + func (p *ProgressBarWidget) Max() float64 + func (p *ProgressBarWidget) Maximum(maximum float64) *ProgressBarWidget + func (p *ProgressBarWidget) Running() bool + func (p *ProgressBarWidget) SetValue(value float64) + func (p *ProgressBarWidget) Start() *ProgressBarWidget + func (p *ProgressBarWidget) Stop() *ProgressBarWidget + func (p *ProgressBarWidget) Value() float64 + func (p *ProgressBarWidget) Vertical() *ProgressBarWidget + type RadioChoice struct + func Choice(label, value string) RadioChoice + func (c RadioChoice) Label() string + func (c RadioChoice) Value() string + type RadioGroupWidget struct + func RadioGroup(value *string, choices ...RadioChoice) *RadioGroupWidget + func (r *RadioGroupWidget) Choices() []RadioChoice + func (r *RadioGroupWidget) Focus() *RadioGroupWidget + func (r *RadioGroupWidget) Horizontal() *RadioGroupWidget + func (r *RadioGroupWidget) OnChange(handler func(string)) *RadioGroupWidget + func (r *RadioGroupWidget) Select(value string) + func (r *RadioGroupWidget) Selected() string + func (r *RadioGroupWidget) SetChoices(choices ...RadioChoice) + func (r *RadioGroupWidget) Vertical() *RadioGroupWidget + type Rect struct + Height float64 + Width float64 + X float64 + Y float64 + type SaveDecision uint8 + const CancelChanges + const DiscardChanges + const SaveChanges + func AskSaveChanges(title, text string) SaveDecision + type ScrollWidget struct + func Scroll(content Widget) *ScrollWidget + func (s *ScrollWidget) Expand() *ScrollWidget + func (s *ScrollWidget) Size(width, height int) *ScrollWidget + type SeparatorWidget struct + func Separator() *SeparatorWidget + func (s *SeparatorWidget) Horizontal() *SeparatorWidget + func (s *SeparatorWidget) Thickness(pixels int) *SeparatorWidget + func (s *SeparatorWidget) Vertical() *SeparatorWidget + type SizeBox struct + func MinSize(content Widget, width, height int) *SizeBox + func Size(content Widget, width, height int) *SizeBox + func (s *SizeBox) Expand() *SizeBox + type SliderWidget struct + func Slider(value *float64, minimum, maximum float64) *SliderWidget + func (s *SliderWidget) Bounds() (minimum, maximum float64) + func (s *SliderWidget) Focus() *SliderWidget + func (s *SliderWidget) Horizontal() *SliderWidget + func (s *SliderWidget) Length(pixels int) *SliderWidget + func (s *SliderWidget) OnChange(handler func(float64)) *SliderWidget + func (s *SliderWidget) SetRange(minimum, maximum float64) *SliderWidget + func (s *SliderWidget) SetValue(value float64) + func (s *SliderWidget) Step(step float64) *SliderWidget + func (s *SliderWidget) Value() float64 + func (s *SliderWidget) Vertical() *SliderWidget + type SpringWidget struct + func Spring() *SpringWidget + type StackLayout struct + func Stack(children ...Widget) *StackLayout + func (s *StackLayout) Expand() *StackLayout + type State struct + func NewState[T any](initial T) *State[T] + func (s *State[T]) Get() T + func (s *State[T]) Set(value T) + func (s *State[T]) Update(change func(T) T) + type TabPage struct + func Tab(title string, content Widget) *TabPage + func (t *TabPage) Title() string + type TableWidget struct + func Table(columns ...string) *TableWidget + func (t *TableWidget) ColumnWidth(column, pixels int) *TableWidget + func (t *TableWidget) Columns() []string + func (t *TableWidget) Expand() *TableWidget + func (t *TableWidget) Height(rows int) *TableWidget + func (t *TableWidget) OnActivate(handler func(row int, values []string)) *TableWidget + func (t *TableWidget) OnSelect(handler func(row int, values []string)) *TableWidget + func (t *TableWidget) Rows() [][]string + func (t *TableWidget) Select(row int) + func (t *TableWidget) Selected() (row int, values []string, ok bool) + func (t *TableWidget) SetRows(rows ...[]string) *TableWidget + type TabsWidget struct + func Tabs(pages ...*TabPage) *TabsWidget + func (t *TabsWidget) Expand() *TabsWidget + func (t *TabsWidget) OnChange(handler func(index int, title string)) *TabsWidget + func (t *TabsWidget) Pages() []*TabPage + func (t *TabsWidget) Select(index int) + func (t *TabsWidget) Selected() (index int, title string, ok bool) + type Task struct + func Background(work func(context.Context, *TaskReporter) error) *Task + func (t *Task) AutoStart() *Task + func (t *Task) Cancel() + func (t *Task) OnDone(callback func(error)) *Task + func (t *Task) OnProgress(callback func(TaskProgress)) *Task + func (t *Task) Progress() TaskProgress + func (t *Task) Running() bool + func (t *Task) Start() + type TaskProgress struct + Message string + Percent float64 + type TaskReporter struct + func (r *TaskReporter) Post(callback func()) bool + func (r *TaskReporter) Report(percent float64, message ...string) bool + type TextAreaWidget struct + func TextArea(value *string) *TextAreaWidget + func (t *TextAreaWidget) Append(text string) + func (t *TextAreaWidget) Clear() + func (t *TextAreaWidget) Copy() + func (t *TextAreaWidget) Cursor() TextPosition + func (t *TextAreaWidget) Cut() + func (t *TextAreaWidget) Expand() *TextAreaWidget + func (t *TextAreaWidget) FindNext(query string) bool + func (t *TextAreaWidget) Focus() *TextAreaWidget + func (t *TextAreaWidget) MarkSaved() + func (t *TextAreaWidget) Modified() bool + func (t *TextAreaWidget) OnChange(handler func(string)) *TextAreaWidget + func (t *TextAreaWidget) OnCursorMove(handler func(TextPosition)) *TextAreaWidget + func (t *TextAreaWidget) Paste() + func (t *TextAreaWidget) Redo() + func (t *TextAreaWidget) ReplaceAll(old, replacement string) int + func (t *TextAreaWidget) ReplaceSelection(replacement string) bool + func (t *TextAreaWidget) SelectAll() + func (t *TextAreaWidget) SetText(text string) + func (t *TextAreaWidget) Size(columns, lines int) *TextAreaWidget + func (t *TextAreaWidget) Text() string + func (t *TextAreaWidget) Undo() + type TextBoxWidget struct + func TextBox(value *string) *TextBoxWidget + func (t *TextBoxWidget) Focus() *TextBoxWidget + func (t *TextBoxWidget) OnChange(handler func(string)) *TextBoxWidget + func (t *TextBoxWidget) OnSubmit(handler func(string)) *TextBoxWidget + func (t *TextBoxWidget) Password() *TextBoxWidget + func (t *TextBoxWidget) Placeholder(text string) *TextBoxWidget + func (t *TextBoxWidget) Width(columns int) *TextBoxWidget + type TextPosition struct + Column int + Line int + type TextStyle struct + Color Color + Size int + type Theme struct + Background Color + Border Color + Danger Color + Muted Color + Primary Color + Success Color + Surface Color + Text Color + type Timer struct + func After(delay time.Duration, callback func()) *Timer + func Animate(framesPerSecond int, frame func()) *Timer + func Every(interval time.Duration, callback func()) *Timer + func (t *Timer) Restart() + func (t *Timer) Running() bool + func (t *Timer) Start() + func (t *Timer) Stop() + type TreeNode struct + func Node(label string, children ...*TreeNode) *TreeNode + func (n *TreeNode) Children() []*TreeNode + func (n *TreeNode) Expanded() *TreeNode + func (n *TreeNode) IsExpanded() bool + func (n *TreeNode) Label() string + func (n *TreeNode) Value() string + func (n *TreeNode) WithValue(value string) *TreeNode + type TreeWidget struct + func Tree(nodes ...*TreeNode) *TreeWidget + func (t *TreeWidget) Expand() *TreeWidget + func (t *TreeWidget) Height(rows int) *TreeWidget + func (t *TreeWidget) Nodes() []*TreeNode + func (t *TreeWidget) OnActivate(handler func(node *TreeNode)) *TreeWidget + func (t *TreeWidget) OnExpand(handler func(node *TreeNode, expanded bool)) *TreeWidget + func (t *TreeWidget) OnSelect(handler func(node *TreeNode)) *TreeWidget + func (t *TreeWidget) Select(node *TreeNode) + func (t *TreeWidget) Selected() (node *TreeNode, ok bool) + func (t *TreeWidget) SetChildren(parent *TreeNode, children ...*TreeNode) + func (t *TreeWidget) SetExpanded(node *TreeNode, expanded bool) + func (t *TreeWidget) SetNodes(nodes ...*TreeNode) *TreeWidget + func (t *TreeWidget) Width(pixels int) *TreeWidget + type Widget interface + func Spacer(width, height int) Widget + type Window struct + func MainWindow() *Window + func NewWindow(options WindowOptions) *Window + func (w *Window) Close() + func (w *Window) Focus() *Window + func (w *Window) IsOpen() bool + func (w *Window) SetTitle(title string) *Window + func (w *Window) Show() *Window + type WindowOptions struct + Content Widget + Height int + Menu *AppMenuBar + OnClose func() + OnCloseRequest func() bool + OnKeyDown func(KeyEvent) + OnKeyUp func(KeyEvent) + Padding int + Parent *Window + Shortcuts []KeyShortcut + Tasks []*Task + Theme Theme + Timers []*Timer + Title string + Width int