objects

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: GPL-3.0 Imports: 7 Imported by: 1

README

objects

Objects contains a standard collection of re-usable objects. All objects in this module visually conform to whatever the theme is set to.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	tomo.TextBox
	// contains filtered or unexported fields
}

Button is a clickable button.

func NewButton

func NewButton(text string) *Button

NewButton creates a new button with the specified text.

func (*Button) OnClick

func (this *Button) OnClick(callback func()) event.Cookie

OnClick specifies a function to be called when the button is clicked.

type Container

type Container struct {
	tomo.ContainerBox
}

Container is an object that can contain other objects. It can be used as a primitive for building more complex layouts. It has two variants: an outer container, and an inner container. The outer container has padding around its edges, whereas the inner container does not. The container will have a corresponding object role variation of either "outer" or "inner".

func NewInnerContainer

func NewInnerContainer(layout tomo.Layout, children ...tomo.Object) *Container

NewInnerContainer creates a new container that has no padding around it.

func NewOuterContainer

func NewOuterContainer(layout tomo.Layout, children ...tomo.Object) *Container

NewOuterContainer creates a new container that has padding around it.

type Heading

type Heading struct {
	tomo.TextBox
}

Heading is a label that denotes the start of some section of content. It can have a level from 0 to 2, with 0 being the most prominent and 2 being the most subtle. The level is described in the role variation.

type Label

type Label struct {
	tomo.TextBox
}

Label is a simple text label.

func NewHeading

func NewHeading(level int, text string) *Label

NewHeading creates a new section heading. The level can be from 0 to 2.

func NewLabel

func NewLabel(text string) *Label

NewLabel creates a new text label.

type Separator

type Separator struct {
	tomo.Box
}

Separator is a line for visually separating elements.

func NewSeparator

func NewSeparator() *Separator

NewSeparator creates a new separator line.

type Slider

type Slider struct {
	tomo.ContainerBox
	// contains filtered or unexported fields
}

func NewHorizontalSlider

func NewHorizontalSlider(value float64) *Slider

func NewVerticalSlider

func NewVerticalSlider(value float64) *Slider

func (*Slider) OnValueChange

func (this *Slider) OnValueChange(callback func()) event.Cookie

func (*Slider) SetValue

func (this *Slider) SetValue(value float64)

func (*Slider) Value

func (this *Slider) Value() float64

type SliderHandle

type SliderHandle struct {
	tomo.Box
}

type TextInput

type TextInput struct {
	tomo.TextBox
	// contains filtered or unexported fields
}

TextInput is a single-line editable text box.

func NewTextInput

func NewTextInput(text string) *TextInput

NewTextInput creates a new text input containing the specified text.

func (*TextInput) OnEnter

func (this *TextInput) OnEnter(callback func()) event.Cookie

OnEnter specifies a function to be called when the user presses enter within the text input.

func (*TextInput) SetText

func (this *TextInput) SetText(text string)

SetText sets the text content of the input.

func (*TextInput) Text

func (this *TextInput) Text() string

Text returns the text content of the input.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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