Documentation ¶
Overview ¶
Package grid allows widgets to be arranged in rows and columns.
Index ¶
- func GenerateWidgets(w IGrid, size gowid.IRenderSize, attrs gowid.IRenderContext) (pile.IWidget, int)
- func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func UserInput(w IGrid, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, ...) bool
- type Align
- type HSepCB
- type IGrid
- type IWidget
- type Options
- type VSepCB
- type Widget
- func (w *Widget) FindNextSelectable(dir gowid.Direction, wrap bool) (int, bool)
- func (w *Widget) Focus() int
- func (w *Widget) GenerateWidgets(size gowid.IRenderSize, attrs gowid.IRenderContext) (pile.IWidget, int)
- func (w *Widget) HAlign() gowid.IHAlignment
- func (w *Widget) HSep() int
- func (w *Widget) KeyIsDown(evk *tcell.EventKey) bool
- func (w *Widget) KeyIsLeft(evk *tcell.EventKey) bool
- func (w *Widget) KeyIsRight(evk *tcell.EventKey) bool
- func (w *Widget) KeyIsUp(evk *tcell.EventKey) bool
- func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
- func (w *Widget) Selectable() bool
- func (w *Widget) SetFocus(app gowid.IApp, i int)
- func (w *Widget) SetHAlign(i gowid.IHAlignment, app gowid.IApp)
- func (w *Widget) SetHSep(i int, app gowid.IApp)
- func (w *Widget) SetSubWidgets(widgets []gowid.IWidget, app gowid.IApp)
- func (w *Widget) SetVSep(i int, app gowid.IApp)
- func (w *Widget) SetWidth(i int, app gowid.IApp)
- func (w *Widget) String() string
- func (w *Widget) SubWidgets() []gowid.IWidget
- func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
- func (w *Widget) VSep() int
- func (w *Widget) Width() int
- func (w *Widget) Wrap() bool
- type Width
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateWidgets ¶
func GenerateWidgets(w IGrid, size gowid.IRenderSize, attrs gowid.IRenderContext) (pile.IWidget, int)
Can't support RenderFixed{} because I need to know how many columns so I can roll over widgets to the next line.
Types ¶
type IGrid ¶
type IGrid interface { gowid.IFindNextSelectable gowid.IFocus SubWidgets() []gowid.IWidget GenerateWidgets(size gowid.IRenderSize, attrs gowid.IRenderContext) (pile.IWidget, int) Width() int HSep() int VSep() int HAlign() gowid.IHAlignment Wrap() bool KeyIsUp(*tcell.EventKey) bool KeyIsDown(*tcell.EventKey) bool KeyIsLeft(*tcell.EventKey) bool KeyIsRight(*tcell.EventKey) bool }
type Widget ¶
type Widget struct { *gowid.Callbacks gowid.SubWidgetsCallbacks gowid.FocusCallbacks // contains filtered or unexported fields }
align sets the alignment of the group within the leftover space in the row.
func (*Widget) FindNextSelectable ¶
func (*Widget) GenerateWidgets ¶
func (w *Widget) GenerateWidgets(size gowid.IRenderSize, attrs gowid.IRenderContext) (pile.IWidget, int)
func (*Widget) HAlign ¶
func (w *Widget) HAlign() gowid.IHAlignment
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func (*Widget) Selectable ¶
func (*Widget) SetSubWidgets ¶
func (*Widget) SubWidgets ¶
Click to show internal directories.
Click to hide internal directories.