Documentation ¶
Index ¶
- Constants
- type Box
- func (ui *Box) Display() Display
- func (ui *Box) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...)
- func (ui *Box) FirstFocus(dui *duit.DUI, self *duit.Kid) *image.Point
- func (ui *Box) FlexDir() Dir
- func (ui *Box) Focus(dui *duit.DUI, self *duit.Kid, o duit.UI) *image.Point
- func (ui *Box) Key(dui *duit.DUI, self *duit.Kid, k rune, m draw.Mouse, orig image.Point) (r duit.Result)
- func (ui *Box) Layout(dui *duit.DUI, self *duit.Kid, sizeAvail image.Point, force bool)
- func (ui *Box) Mark(self *duit.Kid, o duit.UI, forLayout bool) (marked bool)
- func (ui *Box) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, ...) (r duit.Result)
- func (ui *Box) Print(self *duit.Kid, indent int)
- type Boxable
- type Dir
- type Display
- type Grid
- func (ui *Grid) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...)
- func (ui *Grid) FirstFocus(dui *duit.DUI, self *duit.Kid) *image.Point
- func (ui *Grid) Focus(dui *duit.DUI, self *duit.Kid, o duit.UI) *image.Point
- func (ui *Grid) Key(dui *duit.DUI, self *duit.Kid, k rune, m draw.Mouse, orig image.Point) (r duit.Result)
- func (ui *Grid) Layout(dui *duit.DUI, self *duit.Kid, sizeAvail image.Point, force bool)
- func (ui *Grid) Mark(self *duit.Kid, o duit.UI, forLayout bool) (marked bool)
- func (ui *Grid) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, ...) (r duit.Result)
- func (ui *Grid) Print(self *duit.Kid, indent int)
- type Label
- func (ui *Label) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...)
- func (ui *Label) FirstFocus(dui *duit.DUI, self *duit.Kid) *image.Point
- func (ui *Label) Focus(dui *duit.DUI, self *duit.Kid, o duit.UI) *image.Point
- func (ui *Label) Key(dui *duit.DUI, self *duit.Kid, k rune, m draw.Mouse, orig image.Point) (r duit.Result)
- func (ui *Label) Layout(dui *duit.DUI, self *duit.Kid, sizeAvail image.Point, force bool)
- func (ui *Label) Mark(self *duit.Kid, o duit.UI, forLayout bool) (marked bool)
- func (ui *Label) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, ...) (r duit.Result)
- func (ui *Label) Print(self *duit.Kid, indent int)
- func (ui *Label) Rect() draw.Rectangle
- type Scroll
- func (ui *Scroll) Draw(dui *duit.DUI, self *duit.Kid, img *draw.Image, orig image.Point, m draw.Mouse, ...)
- func (ui *Scroll) FirstFocus(dui *duit.DUI, self *duit.Kid) *image.Point
- func (ui *Scroll) Focus(dui *duit.DUI, self *duit.Kid, o duit.UI) *image.Point
- func (ui *Scroll) Free()
- func (ui *Scroll) Key(dui *duit.DUI, self *duit.Kid, k rune, m draw.Mouse, orig image.Point) (r duit.Result)
- func (ui *Scroll) Layout(dui *duit.DUI, self *duit.Kid, sizeAvail image.Point, force bool)
- func (ui *Scroll) Mark(self *duit.Kid, o duit.UI, forLayout bool) (marked bool)
- func (ui *Scroll) Mouse(dui *duit.DUI, self *duit.Kid, m draw.Mouse, origM draw.Mouse, ...) (r duit.Result)
- func (ui *Scroll) Print(self *duit.Kid, indent int)
Constants ¶
View Source
const ( InlineBlock = iota // default Block // always start a new line Inline // flow inline but ignore margin, width and height Flex )
View Source
const ( Row = iota + 1 Column )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Box ¶
type Box struct { Kids []*duit.Kid // Kids and UIs in this box. Reverse bool // Lay out children from bottom to top. First kid will be at the bottom. Margin duit.Space // In lowDPI pixels, will be adjusted for highDPI screens. Padding duit.Space // Padding inside box, so children don't touch the sides; in lowDPI pixels, also adjusted for highDPI screens. Valign duit.Valign // How to align children on a line. Width int // 0 means dynamic (as much as needed), -1 means full width, >0 means that exact amount of lowDPI pixels. Height int // 0 means dynamic (as much as needed), -1 means full height, >0 means that exact amount of lowDPI pixels. MaxWidth int // if >0, the max number of lowDPI pixels that will be used. ContentBox bool // Use ContentBox (BorderBox by default) Disp Display Dir Dir Background *draw.Image `json:"-"` // Background for this box, instead of default duit background. // contains filtered or unexported fields }
Box keeps elements on a line as long as they fit, then moves on to the next line.
func NewReverseBox ¶
NewReverseBox returns a box containing all uis in original order in its Kids field, with the Reverse field set.
type Grid ¶
type Grid struct { Kids []*duit.Kid // Holds UIs in the grid, per row. Columns int // Number of columns. Rows int // Number of rows. RowSpans []int ColSpans []int Valign []duit.Valign // Vertical alignment per column. Halign []duit.Halign // Horizontal alignment per column. Padding []duit.Space // Padding in lowDPI pixels per column. Width int // -1 means full width, 0 means automatic width, >0 means exactly that many lowDPI pixels. Background *draw.Image `json:"-"` // Background color. // contains filtered or unexported fields }
Grid lays out other duit.UIs in a table-like grid.
type Label ¶
type Label struct { Text string // Text to draw, wrapped at glyph boundary. Font *draw.Font `json:"-"` // For drawing text. Click func() (e duit.Event) `json:"-"` // Called on button1 click. Selected bool // contains filtered or unexported fields }
Label draws multiline text in a single font.:
Keys:
cmd-c, copy text \n, like button1 click, calls the Click function
type Scroll ¶
type Scroll struct { Kid duit.Kid Height int // < 0 means full height, 0 means as much as necessary, >0 means exactly that many lowdpi pixels Offset int // current scroll offset in pixels // contains filtered or unexported fields }
Scroll shows a part of its single child, typically a box, and lets you scroll the content.
func (*Scroll) FirstFocus ¶
Click to show internal directories.
Click to hide internal directories.