ui

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const BackendName = "fltk"

BackendName is the name of the backend. It can be used to check which backend is currently in use by the application during runtime.

Variables

This section is empty.

Functions

func Init

func Init()

Init initializes the UI library for the FLTK backend. It locks the OS thread and sets up Spot to be able to intercept the main loop.

func Run

func Run()

Run starts the main loop for the FLTK backend.

Types

type Button

type Button struct {
	X       int
	Y       int
	Width   int
	Height  int
	Title   string
	OnClick func()
	// contains filtered or unexported fields
}

func (*Button) Mount

func (b *Button) Mount(parent spot.Control) any

func (*Button) Render

func (b *Button) Render(ctx *spot.RenderContext) spot.Component

func (*Button) Unmount

func (b *Button) Unmount()

func (*Button) Update

func (b *Button) Update(nextControl spot.Control) bool

type Checkbox

type Checkbox struct {
	X        int
	Y        int
	Width    int
	Height   int
	Label    string
	Checked  bool
	OnChange func(checked bool)
	// contains filtered or unexported fields
}

func (*Checkbox) Mount

func (b *Checkbox) Mount(parent spot.Control) any

func (*Checkbox) Render

func (c *Checkbox) Render(ctx *spot.RenderContext) spot.Component

func (*Checkbox) Update

func (b *Checkbox) Update(nextComponent spot.Control) bool

type Dial

type Dial struct {
	X              int
	Y              int
	Width          int
	Height         int
	Min            float64
	Max            float64
	Value          float64
	OnValueChanged func(float64)
	// contains filtered or unexported fields
}

func (*Dial) Mount

func (b *Dial) Mount(parent spot.Control) any

func (*Dial) Render

func (c *Dial) Render(ctx *spot.RenderContext) spot.Component

func (*Dial) Update

func (b *Dial) Update(nextComponent spot.Control) bool
type Dropdown struct {
	X                    int
	Y                    int
	Width                int
	Height               int
	Items                []string
	SelectedIndex        int
	Editable             bool
	OnSelectionDidChange func(index int)
	// contains filtered or unexported fields
}
func (c *Dropdown) Mount(parent spot.Control) any
func (c *Dropdown) Render(ctx *spot.RenderContext) spot.Component
func (c *Dropdown) Update(next spot.Control) bool

type Image added in v0.3.0

type Image struct {
	X       int
	Y       int
	Width   int
	Height  int
	Border  bool
	OnClick func(x, y int, secondary bool)
	Image   image.Image
	// contains filtered or unexported fields
}

func (*Image) Mount added in v0.3.0

func (c *Image) Mount(parent spot.Control) any

func (*Image) Render added in v0.3.0

func (c *Image) Render(ctx *spot.RenderContext) spot.Component

func (*Image) Unmount added in v0.3.0

func (b *Image) Unmount()

func (*Image) Update added in v0.3.0

func (c *Image) Update(nextControl spot.Control) bool

type Label

type Label struct {
	X        int
	Y        int
	Width    int
	Height   int
	Value    string
	FontSize int
	Align    LabelAlignment
	// contains filtered or unexported fields
}

func (*Label) Mount

func (w *Label) Mount(parent spot.Control) any

func (*Label) Render

func (c *Label) Render(ctx *spot.RenderContext) spot.Component

func (*Label) Unmount

func (w *Label) Unmount()

func (*Label) Update

func (w *Label) Update(nextComponent spot.Control) bool

type LabelAlignment added in v0.2.0

type LabelAlignment int
const (
	LabelAlignmentLeft LabelAlignment = iota
	LabelAlignmentCenter
	LabelAlignmentRight
)

type ListBox added in v0.2.0

type ListBox struct {
	X           int
	Y           int
	Width       int
	Height      int
	Values      []string
	Multiselect bool
	Selection   []int
	OnSelect    func([]int)
	// contains filtered or unexported fields
}

func (*ListBox) Mount added in v0.2.0

func (c *ListBox) Mount(parent spot.Control) any

func (*ListBox) Render added in v0.2.0

func (c *ListBox) Render(ctx *spot.RenderContext) spot.Component

func (*ListBox) Unmount added in v0.3.1

func (c *ListBox) Unmount()

func (*ListBox) Update added in v0.2.0

func (c *ListBox) Update(nextComponent spot.Control) bool

type ProgressBar

type ProgressBar struct {
	X             int
	Y             int
	Width         int
	Height        int
	Min           float64
	Max           float64
	Value         float64
	Indeterminate bool
	// contains filtered or unexported fields
}

func (*ProgressBar) Mount

func (b *ProgressBar) Mount(parent spot.Control) any

func (*ProgressBar) Render

func (c *ProgressBar) Render(ctx *spot.RenderContext) spot.Component

func (*ProgressBar) Update

func (b *ProgressBar) Update(nextComponent spot.Control) bool

type Slider

type Slider struct {
	X              int
	Y              int
	Width          int
	Height         int
	Min            float64
	Max            float64
	Value          float64
	OnValueChanged func(float64)
	// contains filtered or unexported fields
}

func (*Slider) Mount

func (c *Slider) Mount(parent spot.Control) any

func (*Slider) Render

func (c *Slider) Render(ctx *spot.RenderContext) spot.Component

func (*Slider) Unmount added in v0.3.0

func (c *Slider) Unmount()

func (*Slider) Update

func (c *Slider) Update(nextComponent spot.Control) bool

type Spinner

type Spinner struct {
	X              int
	Y              int
	Width          int
	Height         int
	Min            float64
	Max            float64
	Step           float64
	Value          float64
	OnValueChanged func(float64)
	// contains filtered or unexported fields
}

func (*Spinner) Mount

func (b *Spinner) Mount(parent spot.Control) any

func (*Spinner) Render

func (c *Spinner) Render(ctx *spot.RenderContext) spot.Component

func (*Spinner) Update

func (b *Spinner) Update(nextComponent spot.Control) bool

type TextEditor added in v0.3.0

type TextEditor struct {
	X        int
	Y        int
	Width    int
	Height   int
	Text     string
	FontSize int
	OnChange func(content string)
	// contains filtered or unexported fields
}

func (*TextEditor) Mount added in v0.3.0

func (w *TextEditor) Mount(parent spot.Control) any

func (*TextEditor) Render added in v0.3.0

func (c *TextEditor) Render(ctx *spot.RenderContext) spot.Component

func (*TextEditor) Update added in v0.3.0

func (w *TextEditor) Update(nextComponent spot.Control) bool

type TextField

type TextField struct {
	X      int
	Y      int
	Width  int
	Height int
	Value  string
	// FontSize int
	OnChange func(value string)
	// contains filtered or unexported fields
}

func (*TextField) Mount

func (w *TextField) Mount(parent spot.Control) any

func (*TextField) Render

func (c *TextField) Render(ctx *spot.RenderContext) spot.Component

func (*TextField) Update

func (w *TextField) Update(nextComponent spot.Control) bool

type TextView

type TextView struct {
	X        int
	Y        int
	Width    int
	Height   int
	Text     string
	FontSize int
	// contains filtered or unexported fields
}

func (*TextView) Mount

func (w *TextView) Mount(parent spot.Control) any

func (*TextView) Render

func (c *TextView) Render(ctx *spot.RenderContext) spot.Component

func (*TextView) Update

func (w *TextView) Update(nextComponent spot.Control) bool

type Window

type Window struct {
	Title     string
	Width     int
	Height    int
	Resizable bool
	Children  []spot.Component
	// contains filtered or unexported fields
}

func (*Window) BuildNode

func (w *Window) BuildNode(ctx *spot.RenderContext) spot.Node

func (*Window) Mount

func (w *Window) Mount(parent spot.Control) any

func (*Window) Render

func (c *Window) Render(ctx *spot.RenderContext) spot.Component

func (*Window) Update

func (w *Window) Update(nextComponent spot.Control) bool

Directories

Path Synopsis
internal
cocoa
Package cocoa - Go bindings for the Cocoa framework.
Package cocoa - Go bindings for the Cocoa framework.

Jump to

Keyboard shortcuts

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