hpadding

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 4 Imported by: 14

Documentation

Overview

Package hpadding provides a widget that pads an inner widget on the left and right.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func SubWidgetSize

func SubWidgetSize(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize

func UserInput

func UserInput(w IWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

UserInput will adjust the input event's x coordinate depending on the input size and widget alignment. If the input is e.g. IRenderFixed, then no adjustment is made.

Types

type IWidget

type IWidget interface {
	gowid.ICompositeWidget
	Align() gowid.IHAlignment
	Width() gowid.IWidgetDimension
}

type Widget

type Widget struct {
	gowid.IWidget

	*gowid.Callbacks
	gowid.FocusCallbacks
	gowid.SubWidgetCallbacks
	// contains filtered or unexported fields
}

Widget renders the wrapped widget with the provided width; if the wrapped widget is a box, or the wrapped widget is to be packed to a width smaller than specified, the wrapped widget can be aligned in the middle, left or right

func New

func New(inner gowid.IWidget, alignment gowid.IHAlignment, width gowid.IWidgetDimension) *Widget

func (*Widget) Align

func (w *Widget) Align() gowid.IHAlignment

func (*Widget) OnSetAlign

func (w *Widget) OnSetAlign(f gowid.IWidgetChangedCallback)

func (*Widget) OnSetHeight

func (w *Widget) OnSetHeight(f gowid.IWidgetChangedCallback)

func (*Widget) RemoveOnSetAlign

func (w *Widget) RemoveOnSetAlign(f gowid.IIdentity)

func (*Widget) RemoveOnSetHeight

func (w *Widget) RemoveOnSetHeight(f gowid.IIdentity)

func (*Widget) Render

func (w *Widget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas

func (*Widget) RenderSize

func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox

func (*Widget) SetAlign

func (w *Widget) SetAlign(i gowid.IHAlignment, app gowid.IApp)

func (*Widget) SetSubWidget

func (w *Widget) SetSubWidget(wi gowid.IWidget, app gowid.IApp)

func (*Widget) SetWidth

func (w *Widget) SetWidth(i gowid.IWidgetDimension, app gowid.IApp)

func (*Widget) String

func (w *Widget) String() string

func (*Widget) SubWidget

func (w *Widget) SubWidget() gowid.IWidget

func (*Widget) SubWidgetSize

func (w *Widget) SubWidgetSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize

func (*Widget) UserInput

func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool

func (*Widget) Width

func (w *Widget) Width() gowid.IWidgetDimension

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL