Documentation
¶
Overview ¶
Package olt is a repository containing tools and widgets for making programming multi-platform GUIs in pure Go painless and intuitive.
Most GUI frameworks are burdened with legacy object oriented paradigms, and very different APIs and often complex multi-language systems. This is obstructive to the Go programmer, who wants to just use Go for everything. Go's syntax and features allow the creation of concise ways of calling and referring to variables and this is basically syntactic sugar plus extensible, nice set of primitives for building interfaces.
Index ¶
- func DP(i int) unit.Value
- func HorizontalFlexBox() *layout.Flex
- func NewList(scrollToEnd bool) *layout.List
- func Rigid(w layout.Widget) (out layout.FlexChild)
- func VerticalFlexBox() *layout.Flex
- type Box
- type Coord
- type Ctx
- func (c *Ctx) ARGB(rgba uint32) (col color.RGBA)
- func (c *Ctx) ClearError() *Ctx
- func (c Ctx) Ctx() *layout.Context
- func (c *Ctx) DrawRectangle(color color.RGBA, b Box, inset unit.Value)
- func (c *Ctx) EmptyFlexBox(col ...color.RGBA) layout.Widget
- func (c *Ctx) EmptyRigid(box Box, col ...color.RGBA) layout.Widget
- func (c *Ctx) Err() error
- func (c *Ctx) Error() string
- func (c *Ctx) GetHFlexed(weight float32, children ...layout.FlexChild) layout.FlexChild
- func (c *Ctx) GetList(fn func(i int)) List
- func (c *Ctx) GetVFlexed(weight float32, children ...layout.FlexChild) layout.FlexChild
- func (c *Ctx) NewFlexChildren() *FlexChildren
- func (c *Ctx) SetError(err string) *Ctx
- func (c *Ctx) SetErrorLogger(logger func(err string)) *Ctx
- func (c *Ctx) Seterror(err error) *Ctx
- func (c *Ctx) Window() *Window
- type FlexChildren
- func (f *FlexChildren) AddHFlex(weight float32, children *FlexChildren)
- func (f *FlexChildren) AddToEnd(fc layout.FlexChild) *FlexChildren
- func (f *FlexChildren) AddToStart(fc layout.FlexChild) *FlexChildren
- func (f *FlexChildren) AddVFlex(weight float32, children *FlexChildren)
- func (f *FlexChildren) AddWidgets(weight float32, w ...layout.Widget) *FlexChildren
- func (f *FlexChildren) Append(a *FlexChildren) *FlexChildren
- func (f *FlexChildren) Delete(start, end int) *FlexChildren
- func (f *FlexChildren) FlexChildSlice() []layout.FlexChild
- func (f *FlexChildren) Insert(index int, a *FlexChildren) *FlexChildren
- func (f *FlexChildren) InsertAt(fc layout.FlexChild, index int) *FlexChildren
- func (f *FlexChildren) Prepend(a *FlexChildren) *FlexChildren
- func (f *FlexChildren) RenderHFlex() *layout.Flex
- func (f *FlexChildren) RenderVFlex() *layout.Flex
- type LayoutFunc
- type List
- type Radius
- type Widget
- type Widgeter
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HorizontalFlexBox ¶
HorizontalFlexBox returns an empty layout.Flex set to horizontal
func VerticalFlexBox ¶
VerticalFlexBox returns an empty layout.Flex set to vertical
Types ¶
type Ctx ¶
type Ctx struct {
*layout.Context
W *app.Window
L *logi.Logger
// contains filtered or unexported fields
}
Ctx is a wrapper around layout.Context and app.Window and embeds an error so its methods can be chained
func (*Ctx) DrawRectangle ¶
DrawRectangle draws a box with a given set of corner radii and a fill colour
func (*Ctx) EmptyFlexBox ¶
EmptyFlexBox is just a box with a given colour
func (*Ctx) EmptyRigid ¶
EmptyFlexBox is just a box with a given colour
func (*Ctx) GetHFlexed ¶
GetHFlexed returns a layout.FlexChild in horizontal orientation embedded in a layout.FlexChild
func (*Ctx) GetList ¶
GetList returns a simple list composed of a vertical layout.Flex that can scroll up and down
func (*Ctx) GetVFlexed ¶
GetVFlexed returns a layout.FlexChild in vertical orientation embedded in a layout.FlexChild
func (*Ctx) NewFlexChildren ¶
func (c *Ctx) NewFlexChildren() *FlexChildren
NewFlexChildren creates a new FlexChildren and binds itself to it
func (*Ctx) SetErrorLogger ¶
SetErrorLogger loads a function that is used to print errors when they are set
type FlexChildren ¶
FlexChildren is a struct to manage a list of layout.FlexChild(s) and provides a collection of editing functions
func (*FlexChildren) AddHFlex ¶
func (f *FlexChildren) AddHFlex(weight float32, children *FlexChildren)
AddHFlex adds a FlexChildren in horizontal orientation
func (*FlexChildren) AddToEnd ¶
func (f *FlexChildren) AddToEnd(fc layout.FlexChild) *FlexChildren
func (*FlexChildren) AddToStart ¶
func (f *FlexChildren) AddToStart(fc layout.FlexChild) *FlexChildren
func (*FlexChildren) AddVFlex ¶
func (f *FlexChildren) AddVFlex(weight float32, children *FlexChildren)
AddVFlex adds a FlexChildren in vertical orientation
func (*FlexChildren) AddWidgets ¶
func (f *FlexChildren) AddWidgets(weight float32, w ...layout.Widget) *FlexChildren
AddWidgets allows you to add widgets directly to a FlexChildren
func (*FlexChildren) Append ¶
func (f *FlexChildren) Append(a *FlexChildren) *FlexChildren
Append adds more FlexChildren to the end of a FlexChildren and returns it
func (*FlexChildren) Delete ¶
func (f *FlexChildren) Delete(start, end int) *FlexChildren
Delete removes a specified set of elements in a FlexChildren
func (*FlexChildren) FlexChildSlice ¶
func (f *FlexChildren) FlexChildSlice() []layout.FlexChild
FlexChildSlice returns the underlying []layout.FlexChild
func (*FlexChildren) Insert ¶
func (f *FlexChildren) Insert(index int, a *FlexChildren) *FlexChildren
Insert inserts a given FlexChildren inside another FlexChildren and returns it
func (*FlexChildren) InsertAt ¶
func (f *FlexChildren) InsertAt(fc layout.FlexChild, index int) *FlexChildren
func (*FlexChildren) Prepend ¶
func (f *FlexChildren) Prepend(a *FlexChildren) *FlexChildren
Prepend inserts a given FlexChildren before the existing contents and returns it
func (*FlexChildren) RenderHFlex ¶
func (f *FlexChildren) RenderHFlex() *layout.Flex
RenderHFlex returns a horizontal Layout.Flex with its contents inside
func (*FlexChildren) RenderVFlex ¶
func (f *FlexChildren) RenderVFlex() *layout.Flex
RenderVFlex returns a vertical layout.Flex with its contents inside
type LayoutFunc ¶
type LayoutFunc func(c *Ctx)
LayoutFunc is the function signature for a function that creates a new layout.Flex. This is used to create the root widget of a window where all the rest of the render tree is placed
type Radius ¶
type Radius struct {
SE, SW, NE, NW float32
}
Radius is the corner radii for rounded rectangles. Zero means no rounding.
type Widgeter ¶
Widgeter is an interface that provides automatic access to dimensions information for custom widgets
Olt