types

package
v0.0.0-...-0d67019 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bindable

type Bindable interface {
	Name() string
	Watch(BindingWatcher)
	Unwatch(BindingWatcher)
}

type BindableList

type BindableList interface {
	Bindable
	GetAt(int) (any, bool)
	Size() int
}

type BindableStructValue

type BindableStructValue interface {
	Less(BindableStructValue) bool
}

type Binding

type Binding[T comparable] struct {
	// contains filtered or unexported fields
}

func NewBinding

func NewBinding[T comparable](name string, value T) *Binding[T]

func (Binding[T]) Get

func (b Binding[T]) Get() T

func (Binding) Name

func (b Binding) Name() string

func (*Binding[T]) Set

func (b *Binding[T]) Set(value T)

func (Binding) Unwatch

func (b Binding) Unwatch(watcher BindingWatcher)

func (Binding) Watch

func (b Binding) Watch(watcher BindingWatcher)

type BindingWatcher

type BindingWatcher interface {
	BindingChanged(Bindable)
}

type Context

type Context interface {
	Window() Window
	View() View
	Gtx() layout.Context

	FontsDir() *embed.FS
	SetFontsDir(*embed.FS)

	SetView(View)
}

type ListBinding

type ListBinding[T comparable] struct {
	// contains filtered or unexported fields
}

func NewListBinding

func NewListBinding[T comparable](name string, values []T) *ListBinding[T]

func (ListBinding[T]) Get

func (b ListBinding[T]) Get() []T

func (ListBinding[T]) GetAt

func (b ListBinding[T]) GetAt(index int) (any, bool)

func (ListBinding) Name

func (b ListBinding) Name() string

func (*ListBinding[T]) Set

func (b *ListBinding[T]) Set(values []T)

func (ListBinding[T]) Size

func (b ListBinding[T]) Size() int

func (ListBinding) Unwatch

func (b ListBinding) Unwatch(watcher BindingWatcher)

func (ListBinding) Watch

func (b ListBinding) Watch(watcher BindingWatcher)

type SizeConstraint

type SizeConstraint interface {
	unit.Dp | constraints.Float | constraints.Integer
}

type SpacerSize

type SpacerSize = sizeDP

func NewSpacerSize

func NewSpacerSize[T SizeConstraint](w, h T) SpacerSize

NewSpacerSize creates a new SpacerSize struct with the given width and height.

Parameters: - w: the width of the spacer. - h: the height of the spacer.

Returns: - SpacerSize: a struct representing the spacer size with the given width and height.

type StructBinding

type StructBinding[T BindableStructValue] struct {
	// contains filtered or unexported fields
}

func NewStructBinding

func NewStructBinding[T BindableStructValue](name string, value T) *StructBinding[T]

func (StructBinding[T]) Get

func (b StructBinding[T]) Get() T

func (StructBinding) Name

func (b StructBinding) Name() string

func (*StructBinding[T]) Set

func (b *StructBinding[T]) Set(value T)

func (StructBinding) Unwatch

func (b StructBinding) Unwatch(watcher BindingWatcher)

func (StructBinding) Watch

func (b StructBinding) Watch(watcher BindingWatcher)

type StructListBinding

type StructListBinding[T BindableStructValue] struct {
	// contains filtered or unexported fields
}

func NewStructListBinding

func NewStructListBinding[T BindableStructValue](name string, values []T) *StructListBinding[T]

func (StructListBinding[T]) Get

func (b StructListBinding[T]) Get() []T

func (StructListBinding[T]) GetAt

func (b StructListBinding[T]) GetAt(index int) (any, bool)

func (StructListBinding) Name

func (b StructListBinding) Name() string

func (*StructListBinding[T]) Set

func (b *StructListBinding[T]) Set(values []T)

func (StructListBinding[T]) Size

func (b StructListBinding[T]) Size() int

func (StructListBinding) Unwatch

func (b StructListBinding) Unwatch(watcher BindingWatcher)

func (StructListBinding) Watch

func (b StructListBinding) Watch(watcher BindingWatcher)

type UIElement

type UIElement interface {
	HandleEvents(Context)
	Draw(giolayout.Context) giolayout.Dimensions

	ID() string
	SetID(string)

	Wnd() Window
}

type View

type View interface {
	UIElement

	Initialize(Context) error
	Destroy(Context) error

	DrawView(Context) giolayout.Dimensions

	FindFunction(string) any
	FindBinding(string) Bindable
}

type ViewModel

type ViewModel interface {
	Initialize() error
	Destroy() error

	GetBinding(string) Bindable
}

type Window

type Window interface {
	Theme() *material.Theme
	Invalidate()
}

type WindowSize

type WindowSize = sizeDP

func NewWindowSize

func NewWindowSize[T SizeConstraint](w, h T) WindowSize

NewWindowSize creates a new WindowSize struct with the given width and height.

Parameters: - w: the width of the window. - h: the height of the window.

Returns: - WindowSize: a struct representing the window size with the given width and height.

Jump to

Keyboard shortcuts

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