Versions in this module Expand all Collapse all v0 v0.0.1 Apr 22, 2022 Changes in this version + const BorderSize + const Button1 + const Button2 + const Button3 + const Button4 + const Button5 + const Clean + const Dirty + const DirtyKid + const ScrollbarSize + var EditPadding = Space + func Alert(text string) (err error) + func AppDataDir(app string) string + func KidsDraw(dui *DUI, self *Kid, kids []*Kid, uiSize image.Point, bg, img *draw.Image, ...) + func KidsFirstFocus(dui *DUI, self *Kid, kids []*Kid) *image.Point + func KidsFocus(dui *DUI, self *Kid, kids []*Kid, ui UI) *image.Point + func KidsLayout(dui *DUI, self *Kid, kids []*Kid, force bool) (done bool) + func KidsMark(self *Kid, kids []*Kid, o UI, forLayout bool) (marked bool) + func KidsPrint(kids []*Kid, indent int) + func PrintUI(s string, self *Kid, indent int) + func ReadImage(display *draw.Display, f io.Reader) (*draw.Image, error) + func ReadImagePath(display *draw.Display, path string) (*draw.Image, error) + type Box struct + Background *draw.Image + Height int + Kids []*Kid + Margin image.Point + MaxWidth int + Padding Space + Reverse bool + Valign Valign + Width int + func NewBox(uis ...UI) *Box + func NewReverseBox(uis ...UI) *Box + func (ui *Box) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Box) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Box) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Box) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Box) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Box) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Box) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Box) Print(self *Kid, indent int) + type Button struct + Click func() (e Event) + Colorset *Colorset + Disabled bool + Font *draw.Font + Icon Icon + Text string + func (ui *Button) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Button) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Button) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Button) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Button) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Button) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Button) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Button) Print(self *Kid, indent int) + type Buttongroup struct + Changed func(index int) (e Event) + Disabled bool + Font *draw.Font + Selected int + Texts []string + func (ui *Buttongroup) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Buttongroup) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Buttongroup) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Buttongroup) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Buttongroup) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Buttongroup) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Buttongroup) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Buttongroup) Print(self *Kid, indent int) + type Checkbox struct + Changed func() (e Event) + Checked bool + Disabled bool + Font *draw.Font + func (ui *Checkbox) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Checkbox) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Checkbox) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Checkbox) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Checkbox) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Checkbox) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Checkbox) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Checkbox) Print(self *Kid, indent int) + type Colors struct + Background *draw.Image + Border *draw.Image + Text *draw.Image + type Colorset struct + Hover Colors + Normal Colors + type Cursor struct + Cur int64 + Start int64 + func (c Cursor) Ordered() (int64, int64) + type DUI struct + Background *draw.Image + BackgroundColor draw.Color + Call chan func() + CommandMode *draw.Image + Danger Colorset + Debug bool + DebugDraw int + DebugKids bool + DebugLayout int + Disabled Colors + Display *draw.Display + Error chan error + Gutter *draw.Image + Inputs chan Input + Inverse Colors + Placeholder Colors + Primary Colorset + Regular Colorset + ScrollBGHover *draw.Image + ScrollBGNormal *draw.Image + ScrollVisibleHover *draw.Image + ScrollVisibleNormal *draw.Image + Secondary Colorset + Selection Colors + SelectionHover Colors + Striped Colors + Success Colorset + Top Kid + VisualMode *draw.Image + func NewDUI(name string, opts *DUIOpts) (dui *DUI, err error) + func (d *DUI) Close() + func (d *DUI) Draw() + func (d *DUI) Focus(ui UI) + func (d *DUI) Font(font *draw.Font) *draw.Font + func (d *DUI) Input(e Input) + func (d *DUI) Key(k rune) + func (d *DUI) Layout() + func (d *DUI) MarkDraw(ui UI) + func (d *DUI) MarkLayout(ui UI) + func (d *DUI) Mouse(m draw.Mouse) + func (d *DUI) ReadSettings(self *Kid, v interface{}) bool + func (d *DUI) ReadSnarf() (buf []byte, success bool) + func (d *DUI) Render() + func (d *DUI) Resize() + func (d *DUI) Scale(n int) int + func (d *DUI) ScaleSpace(s Space) Space + func (d *DUI) WriteSettings(self *Kid, v interface{}) bool + func (d *DUI) WriteSnarf(buf []byte) + type DUIOpts struct + Dimensions string + FontName string + type Edit struct + Click func(m draw.Mouse, offset int64) (e Event) + Colors *EditColors + DirtyChanged func(dirty bool) + Error chan error + Font *draw.Font + Keys func(k rune, m draw.Mouse) (e Event) + LastSearch string + NoScrollbar bool + func NewEdit(f SeekReaderAt) (ui *Edit, err error) + func (ui *Edit) Append(buf []byte) + func (ui *Edit) Cursor() Cursor + func (ui *Edit) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Edit) EditReader(offset int64) EditReader + func (ui *Edit) ExpandedText() ([]byte, error) + func (ui *Edit) FirstFocus(dui *DUI, self *Kid) (warp *image.Point) + func (ui *Edit) Focus(dui *DUI, self *Kid, o UI) (warp *image.Point) + func (ui *Edit) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Edit) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Edit) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Edit) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Edit) Print(self *Kid, indent int) + func (ui *Edit) Reader() ReaderReaderAt + func (ui *Edit) Replace(c Cursor, buf []byte) + func (ui *Edit) ReverseEditReader(offset int64) EditReader + func (ui *Edit) Saved() + func (ui *Edit) ScrollCursor(dui *DUI) + func (ui *Edit) Search(dui *DUI, reverse bool) (match bool) + func (ui *Edit) Selection() ([]byte, error) + func (ui *Edit) SetCursor(c Cursor) + func (ui *Edit) Size() int64 + func (ui *Edit) Text() ([]byte, error) + type EditColors struct + Bg *draw.Image + CommandBorder *draw.Image + Fg *draw.Image + HoverScrollBg *draw.Image + HoverScrollVis *draw.Image + ScrollBg *draw.Image + ScrollVis *draw.Image + SelBg *draw.Image + SelFg *draw.Image + VisualBorder *draw.Image + type EditReader interface + Get func() (r rune) + Line func(includeNewline bool) (runes int, s string, eof bool) + Nonwhitespace func() (s string, eof bool) + Nonwhitespacepunct func() (s string, eof bool) + Offset func() (offset int64) + Peek func() (r rune, eof bool) + Punctuation func() (s string, eof bool) + TryGet func() (r rune, err error) + Whitespace func(newline bool) (s string, eof bool) + Whitespacepunct func(newline bool) (s string, eof bool) + type Event struct + Consumed bool + NeedDraw bool + NeedLayout bool + type Field struct + Changed func(text string) (e Event) + Cursor1 int + Disabled bool + Font *draw.Font + Keys func(k rune, m draw.Mouse) (e Event) + Password bool + Placeholder string + SelectionStart1 int + Text string + func (ui *Field) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Field) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Field) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Field) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Field) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Field) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Field) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Field) Print(self *Kid, indent int) + type Grid struct + Background *draw.Image + Columns int + Halign []Halign + Kids []*Kid + Padding []Space + Valign []Valign + Width int + func (ui *Grid) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Grid) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Grid) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Grid) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Grid) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Grid) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Grid) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Grid) Print(self *Kid, indent int) + type Gridfit byte + const FitNormal + const FitSlim + type Gridlist struct + Changed func(index int) (e Event) + Click func(index int, m draw.Mouse) (e Event) + Fit Gridfit + Font *draw.Font + Halign []Halign + Header *Gridrow + Keys func(k rune, m draw.Mouse) (e Event) + Multiple bool + Padding Space + Rows []*Gridrow + Striped bool + func (ui *Gridlist) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Gridlist) FirstFocus(dui *DUI, self *Kid) (warp *image.Point) + func (ui *Gridlist) Focus(dui *DUI, self *Kid, o UI) (warp *image.Point) + func (ui *Gridlist) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Gridlist) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Gridlist) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Gridlist) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Gridlist) Print(self *Kid, indent int) + func (ui *Gridlist) Selected() (indices []int) + type Gridrow struct + Selected bool + Value interface{} + Values []string + type Halign byte + const HalignLeft + const HalignMiddle + const HalignRight + type Icon struct + Font *draw.Font + Rune rune + type Image struct + Image *draw.Image + func (ui *Image) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Image) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Image) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Image) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Image) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Image) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Image) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Image) Print(self *Kid, indent int) + type Input struct + Error error + Func func() + Key rune + Mouse draw.Mouse + Type InputType + type InputType byte + const InputError + const InputFunc + const InputKey + const InputMouse + const InputResize + type Kid struct + Draw State + ID string + Layout State + R image.Rectangle + UI UI + func NewKids(uis ...UI) []*Kid + func (k *Kid) Mark(o UI, forLayout bool) (marked bool) + func (k *Kid) MarshalJSON() ([]byte, error) + type Label struct + Click func() (e Event) + Font *draw.Font + Text string + func (ui *Label) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Label) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Label) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Label) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Label) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Label) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Label) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Label) Print(self *Kid, indent int) + type List struct + Changed func(index int) (e Event) + Click func(index int, m draw.Mouse) (e Event) + Font *draw.Font + Keys func(k rune, m draw.Mouse) (e Event) + Multiple bool + Values []*ListValue + func (ui *List) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *List) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *List) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *List) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *List) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *List) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *List) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *List) Print(self *Kid, indent int) + func (ui *List) Selected() (indices []int) + func (ui *List) Unselect(indices []int) + type ListValue struct + Selected bool + Text string + Value interface{} + type Middle struct + Background *draw.Image + Kid *Kid + func NewMiddle(padding Space, ui UI) *Middle + func (ui *Middle) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Middle) FirstFocus(dui *DUI, self *Kid) (warp *image.Point) + func (ui *Middle) Focus(dui *DUI, self *Kid, o UI) (warp *image.Point) + func (ui *Middle) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Middle) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Middle) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Middle) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Middle) Print(self *Kid, indent int) + type Pick struct + Pick func(sizeAvail image.Point) UI + func (ui *Pick) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Pick) FirstFocus(dui *DUI, self *Kid) (warp *image.Point) + func (ui *Pick) Focus(dui *DUI, self *Kid, o UI) (warp *image.Point) + func (ui *Pick) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Pick) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Pick) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Pick) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Pick) Print(self *Kid, indent int) + type Place struct + Background *draw.Image + Kids []*Kid + Place func(self *Kid, sizeAvail image.Point) + func (ui *Place) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Place) FirstFocus(dui *DUI, self *Kid) (warp *image.Point) + func (ui *Place) Focus(dui *DUI, self *Kid, o UI) (warp *image.Point) + func (ui *Place) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Place) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Place) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Place) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Place) Print(self *Kid, indent int) + type Radiobutton struct + Changed func(v interface{}) (e Event) + Disabled bool + Font *draw.Font + Group RadiobuttonGroup + Selected bool + Value interface{} + func (ui *Radiobutton) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Radiobutton) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Radiobutton) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Radiobutton) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Radiobutton) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Radiobutton) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Radiobutton) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Radiobutton) Print(self *Kid, indent int) + func (ui *Radiobutton) Select(dui *DUI) + type RadiobuttonGroup []*Radiobutton + func (g RadiobuttonGroup) Selected() *Radiobutton + type ReaderReaderAt interface + type Result struct + Consumed bool + Hit UI + Warp *image.Point + func KidsKey(dui *DUI, self *Kid, kids []*Kid, key rune, m draw.Mouse, orig image.Point) (r Result) + func KidsMouse(dui *DUI, self *Kid, kids []*Kid, m draw.Mouse, origM draw.Mouse, ...) (r Result) + type Scroll struct + Height int + Kid Kid + func NewScroll(ui UI) *Scroll + func (ui *Scroll) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Scroll) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Scroll) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Scroll) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Scroll) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Scroll) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Scroll) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Scroll) Print(self *Kid, indent int) + type SeekReaderAt interface + type Space struct + Bottom int + Left int + Right int + Top int + func NSpace(n int, space Space) []Space + func NSpaceXY(n, x, y int) []Space + func SpacePt(p image.Point) Space + func SpaceXY(x, y int) Space + func (s Space) Dx() int + func (s Space) Dy() int + func (s Space) Inset(r image.Rectangle) image.Rectangle + func (s Space) Mul(n int) Space + func (s Space) Size() image.Point + func (s Space) Topleft() image.Point + type Split struct + Background *draw.Image + Gutter int + Kids []*Kid + Split func(dim int) (dims []int) + Vertical bool + func (ui *Split) Dimensions(dui *DUI, dims []int) []int + func (ui *Split) Draw(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + func (ui *Split) FirstFocus(dui *DUI, self *Kid) *image.Point + func (ui *Split) Focus(dui *DUI, self *Kid, o UI) *image.Point + func (ui *Split) Key(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + func (ui *Split) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Split) Mark(self *Kid, o UI, forLayout bool) (marked bool) + func (ui *Split) Mouse(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + func (ui *Split) Print(self *Kid, indent int) + type State byte + type Tabs struct + Buttongroup *Buttongroup + UIs []UI + func (ui *Tabs) Layout(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + func (ui *Tabs) Print(self *Kid, indent int) + type UI interface + Draw func(dui *DUI, self *Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...) + FirstFocus func(dui *DUI, self *Kid) (warp *image.Point) + Focus func(dui *DUI, self *Kid, o UI) (warp *image.Point) + Key func(dui *DUI, self *Kid, k rune, m draw.Mouse, orig image.Point) (r Result) + Layout func(dui *DUI, self *Kid, sizeAvail image.Point, force bool) + Mark func(self *Kid, o UI, forLayout bool) (marked bool) + Mouse func(dui *DUI, self *Kid, m draw.Mouse, origM draw.Mouse, orig image.Point) (r Result) + Print func(self *Kid, indent int) + func CenterUI(space Space, ui UI) UI + type Valign byte + const ValignBottom + const ValignMiddle + const ValignTop