Documentation ¶
Overview ¶
Package button provides a clickable widget which can be decorated.
Index ¶
- Variables
- func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas
- func RenderSize(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
- func SubWidgetSize(w IWidget, size interface{}, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize
- func UserInput(w IClickableIdentityWidget, ev interface{}, size gowid.IRenderSize, ...) bool
- type Decoration
- type IClickableIdentityWidget
- type ICustomKeys
- type IDecoratedAround
- type IDecoratedMiddle
- type IWidget
- type Options
- type Widget
- func (w *Widget) Click(app gowid.IApp)
- func (w *Widget) CustomSelectKeys() 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) SelectKeys() []gowid.IKey
- func (w *Widget) SetLeftDec(dec string, app gowid.IApp)
- func (w *Widget) SetRightDec(dec string, 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 ¶
View Source
var ( BareDecoration = Decoration{Left: "", Right: ""} NormalDecoration = Decoration{Left: "<", Right: ">"} AltDecoration = Decoration{Left: "[", Right: "]"} )
Functions ¶
func RenderSize ¶
func RenderSize(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func SubWidgetSize ¶
func UserInput ¶
func UserInput(w IClickableIdentityWidget, ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
Types ¶
type Decoration ¶
Decoration is a simple struct that implements IDecoratedAround.
func (*Decoration) LeftDec ¶
func (b *Decoration) LeftDec() string
func (*Decoration) RightDec ¶
func (b *Decoration) RightDec() string
func (*Decoration) SetLeftDec ¶
func (w *Decoration) SetLeftDec(dec string, app gowid.IApp)
func (*Decoration) SetRightDec ¶
func (w *Decoration) SetRightDec(dec string, app gowid.IApp)
type IClickableIdentityWidget ¶
type IClickableIdentityWidget interface { gowid.IClickableWidget gowid.IIdentity }
type ICustomKeys ¶
type IDecoratedAround ¶
IDecoratedAround is the interface for any type that provides "decoration" on its left and right side e.g. for buttons, something like "<" and ">".
type IDecoratedMiddle ¶
type IDecoratedMiddle interface {
MiddleDec() string
}
IDecoratedMiddle is implemented by any type that provides "decoration" in the middle of its render, such as a 'x' or a '-' symbol on a checked button.
type IWidget ¶
type IWidget interface { gowid.ICompositeWidget IDecoratedAround }
IWidget is implemented by any widget that contains exactly one exposed subwidget (ICompositeWidget) and that is decorated on its left and right (IDecoratedAround).
type Widget ¶
type Widget struct { *gowid.Callbacks gowid.SubWidgetCallbacks gowid.ClickCallbacks *Decoration gowid.AddressProvidesID gowid.IsSelectable // contains filtered or unexported fields }
func NewDecorated ¶
func NewDecorated(inner gowid.IWidget, decoration Decoration) *Widget
func (*Widget) CustomSelectKeys ¶
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func (*Widget) SelectKeys ¶
func (*Widget) SubWidgetSize ¶
func (w *Widget) SubWidgetSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderSize
Click to show internal directories.
Click to hide internal directories.