Documentation ¶
Overview ¶
Package columns provides a widget for organizing other widgets in columns.
Index ¶
- Variables
- func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func RenderSize(w gowid.ICompositeMultipleWidget, size gowid.IRenderSize, focus gowid.Selector, ...) gowid.IRenderBox
- func RenderSubWidgets(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, ...) []gowid.ICanvas
- func RenderedSubWidgetsSizes(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, ...) []gowid.IRenderBox
- func Scroll(w IFocusSelectable, dir gowid.Direction, wrap bool, app gowid.IApp) bool
- func SubWidgetSize(size gowid.IRenderSize, newX int, dim gowid.IWidgetDimension) gowid.IRenderSize
- func UserInput(w IWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, ...) bool
- func WidgetWidths(w ICompositeMultipleDimensionsExt, size gowid.IRenderSize, ...) []int
- type ICompositeMultipleDimensionsExt
- type IFocusSelectable
- type IWidget
- type IWidthHelper
- type Options
- type Widget
- func (w *Widget) Dimensions() []gowid.IWidgetDimension
- func (w *Widget) FindNextSelectable(dir gowid.Direction, wrap bool) (int, bool)
- func (w *Widget) Focus() int
- func (w *Widget) GetPreferedPosition() gwutil.IntOption
- func (w *Widget) KeyIsLeft(evk *tcell.EventKey) bool
- func (w *Widget) KeyIsRight(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) RenderSubWidgets(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.ICanvas
- func (w *Widget) RenderedSubWidgetsSizes(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.IRenderBox
- func (w *Widget) SelectChild(f gowid.Selector) bool
- func (w *Widget) Selectable() bool
- func (w *Widget) SetDimensions(dimensions []gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) SetFocus(app gowid.IApp, i int)
- func (w *Widget) SetPreferedPosition(cols int, app gowid.IApp)
- func (w *Widget) SetSubWidgets(widgets []gowid.IWidget, app gowid.IApp)
- func (w *Widget) String() string
- func (w *Widget) SubWidgetSize(size gowid.IRenderSize, newX int, sub gowid.IWidget, ...) gowid.IRenderSize
- 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) WidgetWidths(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []int
- func (w *Widget) WidthHelpers() ([]bool, []bool)
- func (w *Widget) Wrap() bool
Constants ¶
This section is empty.
Variables ¶
var AllChildrenMaxDimension = fmt.Errorf("All columns widgets were rendered Max, so there is no max height to use.")
Functions ¶
func RenderSize ¶
func RenderSize(w gowid.ICompositeMultipleWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func RenderSubWidgets ¶
func RenderSubWidgets(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.ICanvas
RenderSubWidgets returns an array of canvases for each of the subwidgets, rendering them with in the context of a column with the provided size and focus.
func RenderedSubWidgetsSizes ¶
func RenderedSubWidgetsSizes(w IWidget, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.IRenderBox
RenderedSubWidgetsSizes returns an array of boxes that bound each of the subwidgets as they would be rendered with the given size and focus.
func SubWidgetSize ¶
func SubWidgetSize(size gowid.IRenderSize, newX int, dim gowid.IWidgetDimension) gowid.IRenderSize
func WidgetWidths ¶
func WidgetWidths(w ICompositeMultipleDimensionsExt, size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []int
Types ¶
type ICompositeMultipleDimensionsExt ¶
type ICompositeMultipleDimensionsExt interface { gowid.ICompositeMultipleDimensions gowid.ISelectChild }
type IFocusSelectable ¶
type IFocusSelectable interface { gowid.IFocus gowid.IFindNextSelectable }
type IWidget ¶
type IWidget interface { gowid.ICompositeMultipleWidget gowid.ISettableDimensions gowid.ISettableSubWidgets gowid.IFindNextSelectable gowid.IPreferedPosition gowid.ISelectChild gowid.IIdentity WidgetWidths(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []int Wrap() bool KeyIsLeft(*tcell.EventKey) bool KeyIsRight(*tcell.EventKey) bool }
type IWidthHelper ¶
type Options ¶
type Options struct { StartColumn int // column that gets initial focus Wrap bool // whether or not to wrap from last column to first with movement operations DoNotSetSelected bool // Whether or not to set the focus.Selected field for the selected child LeftKeys []vim.KeyPress RightKeys []vim.KeyPress }
type Widget ¶
type Widget struct { *gowid.Callbacks gowid.AddressProvidesID gowid.SubWidgetsCallbacks gowid.FocusCallbacks // contains filtered or unexported fields }
func NewWithDim ¶
func NewWithDim(method gowid.IWidgetDimension, ws ...interface{}) *Widget
func (*Widget) Dimensions ¶
func (w *Widget) Dimensions() []gowid.IWidgetDimension
func (*Widget) FindNextSelectable ¶
func (*Widget) GetPreferedPosition ¶
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
RenderSize computes the size of this widget when it renders. This is done by computing the sizes of each subwidget, then arranging them the same way that Render() does.
func (*Widget) RenderSubWidgets ¶
func (*Widget) RenderedSubWidgetsSizes ¶
func (w *Widget) RenderedSubWidgetsSizes(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []gowid.IRenderBox
func (*Widget) Selectable ¶
func (*Widget) SetDimensions ¶
func (w *Widget) SetDimensions(dimensions []gowid.IWidgetDimension, app gowid.IApp)
func (*Widget) SetSubWidgets ¶
func (*Widget) SubWidgetSize ¶
func (w *Widget) SubWidgetSize(size gowid.IRenderSize, newX int, sub gowid.IWidget, dim gowid.IWidgetDimension) gowid.IRenderSize
Construct the context in which each subwidget will be rendered. It's important to preserve the type of context e.g. a subwidget may only support being rendered in a fixed context. The newX parameter is the width the subwidget will have within the context of the Columns widget.
func (*Widget) SubWidgets ¶
func (*Widget) WidgetWidths ¶
func (w *Widget) WidgetWidths(size gowid.IRenderSize, focus gowid.Selector, focusIdx int, app gowid.IApp) []int
Return a slice of ints representing the width in columns for each of the subwidgets to be rendered in this context given the size argument.