Documentation ¶
Overview ¶
Package vpadding provides a widget that pads an inner widget on the top and bottom.
Index ¶
- func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func SubWidgetSize(w IVerticalPadding, size gowid.IRenderSize, focus gowid.Selector, ...) gowid.IRenderSize
- func UserInput(w IWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, ...) bool
- type IVerticalPadding
- type IWidget
- type Widget
- func (w *Widget) Align() gowid.IVAlignment
- func (w *Widget) Height() gowid.IWidgetDimension
- func (w *Widget) OnSetAlign(f gowid.IWidgetChangedCallback)
- func (w *Widget) OnSetHeight(f gowid.IWidgetChangedCallback)
- func (w *Widget) RemoveOnSetAlign(f gowid.IIdentity)
- func (w *Widget) RemoveOnSetHeight(f gowid.IIdentity)
- 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) SetAlign(i gowid.IVAlignment, app gowid.IApp)
- func (w *Widget) SetHeight(i gowid.IWidgetDimension, app gowid.IApp)
- func (w *Widget) SetSubWidget(wi gowid.IWidget, app gowid.IApp)
- func (w *Widget) String() string
- func (w *Widget) SubWidget() gowid.IWidget
- func (w *Widget) SubWidgetSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize
- func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SubWidgetSize ¶
func SubWidgetSize(w IVerticalPadding, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize
Types ¶
type IVerticalPadding ¶
type IVerticalPadding interface { Align() gowid.IVAlignment Height() gowid.IWidgetDimension }
type IWidget ¶
type IWidget interface { gowid.ICompositeWidget IVerticalPadding }
type Widget ¶
type Widget struct { gowid.IWidget *gowid.Callbacks gowid.FocusCallbacks gowid.SubWidgetCallbacks // contains filtered or unexported fields }
Widget wraps a widget and aligns it vertically according to the supplied arguments. The wrapped widget can be aligned to the top, bottom or middle, and can be provided with a specific height in #lines.
func New ¶
func New(inner gowid.IWidget, alignment gowid.IVAlignment, height gowid.IWidgetDimension) *Widget
func (*Widget) Align ¶
func (w *Widget) Align() gowid.IVAlignment
func (*Widget) Height ¶
func (w *Widget) Height() gowid.IWidgetDimension
func (*Widget) OnSetAlign ¶
func (w *Widget) OnSetAlign(f gowid.IWidgetChangedCallback)
func (*Widget) OnSetHeight ¶
func (w *Widget) OnSetHeight(f gowid.IWidgetChangedCallback)
func (*Widget) RemoveOnSetAlign ¶
func (*Widget) RemoveOnSetHeight ¶
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func (*Widget) SubWidgetSize ¶
func (w *Widget) SubWidgetSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize
SubWidgetSize returns the size that will be passed down to the subwidget's Render(), based on the size passed to the current widget. If this widget is rendered in a Flow context and the vertical height specified is in Units, then the subwidget is rendered in a Box content with Units-number-of-rows. This gives the subwidget an opportunity to render to fill the space given to it, rather than risking truncation. If the subwidget cannot render in Box mode, then wrap it in a FlowToBoxWidget first.