Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Button ¶
type Button struct { tomo.ContainerBox // contains filtered or unexported fields }
Button is a clickable button.
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 ¶
NewInnerContainer creates a new container that has no padding around it.
type Heading ¶
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 Icon ¶ added in v0.5.0
Icon displays a single icon.
func NewMimeIcon ¶ added in v0.5.0
NewMimeIcon creates a new icon from a MIME type.
func (*Icon) SetTexture ¶ added in v0.5.0
type Label ¶
Label is a simple text label.
func NewHeading ¶
NewHeading creates a new section heading. The level can be from 0 to 2.
type ScrollContainer ¶ added in v0.7.0
type ScrollContainer struct { tomo.ContainerBox // contains filtered or unexported fields }
ScrollContainer couples a ContentBox with one or two Scrollbars.
func NewScrollContainer ¶ added in v0.7.0
func NewScrollContainer(sides ScrollSide) *ScrollContainer
NewScrollContainer creates a new scroll container.
func (*ScrollContainer) SetRoot ¶ added in v0.7.0
func (this *ScrollContainer) SetRoot(root tomo.ContentBox)
SetRoot sets the root child of the ScrollContainer. There can only be one at a time, and setting it will remove and unlink the current child if there is one.
type ScrollSide ¶ added in v0.7.0
type ScrollSide int
ScrollSide determines which Scrollbars are active in a ScrollContainer.
const ( ScrollVertical ScrollSide = 1 << iota ScrollHorizontal ScrollBoth = ScrollVertical | ScrollHorizontal )
func (ScrollSide) Horizontal ¶ added in v0.7.0
func (sides ScrollSide) Horizontal() bool
Horizontal returns true if the side includes a horizontal bar.
func (ScrollSide) String ¶ added in v0.7.0
func (sides ScrollSide) String() string
String returns one of:
- both
- horizontal
- vertical
- none
func (ScrollSide) Vertical ¶ added in v0.7.0
func (sides ScrollSide) Vertical() bool
Vertical returns true if the side includes a vertical bar.
type Scrollbar ¶ added in v0.6.0
type Scrollbar struct { tomo.ContainerBox // contains filtered or unexported fields }
Scrollbar is a special type of slider that can control the scroll of any overflowing ContainerBox.
func NewHorizontalScrollbar ¶ added in v0.6.0
func NewHorizontalScrollbar() *Scrollbar
NewHorizontalScrollbar creates a new horizontal scrollbar.
func NewVerticalScrollbar ¶ added in v0.6.0
func NewVerticalScrollbar() *Scrollbar
NewVerticalScrollbar creates a new vertical scrollbar.
func (*Scrollbar) Link ¶ added in v0.6.0
func (this *Scrollbar) Link(box tomo.ContentBox) event.Cookie
Link assigns this scrollbar to a ContentBox. Closing the returned cookie will unlink it.
func (*Scrollbar) OnValueChange ¶ added in v0.6.0
OnValueChange specifies a function to be called when the position of the scrollbar changes.
type Slider ¶
type Slider struct { tomo.ContainerBox // contains filtered or unexported fields }
Slider is a control that selects a numeric value between 0 and 1.
func NewHorizontalSlider ¶
NewHorizontalSlider creates a new horizontal slider with the specified value.
func NewVerticalSlider ¶
NewVerticalSlider creates a new vertical slider with the specified value.
func (*Slider) OnValueChange ¶
OnValueChange specifies a function to be called when the slider's value changes.
type SliderHandle ¶
SliderHandle is a simple object that serves as a handle for sliders and scrollbars. It is completely inert.
type TextInput ¶
TextInput is a single-line editable text box.
func NewTextInput ¶
NewTextInput creates a new text input containing the specified text.
func (*TextInput) OnEnter ¶
OnEnter specifies a function to be called when the user presses enter within the text input.