Versions in this module Expand all Collapse all v1 v1.4.2 Sep 22, 2024 v1.4.1 Sep 22, 2024 Changes in this version + func CalculateTopMiddleBottom(w IWidget, size gowid.IRenderSize) (int, int, int) + func GetCoordsFromCursorPos(cursorPos int, maxCol int, layout *TextLayout, at IChrAt) (x int, y int) + func GetCursorPosFromCoords(ccol int, crow int, layout *TextLayout, at IChrAt) int + func IsBreakableSpace(chr rune) bool + func Render(w IWidget, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas + type Content []StyledRune + func NewContent(content []ContentSegment) *Content + func (h *Content) AddAt(idx int, content ContentSegment) + func (h *Content) Clone() IContent + func (h *Content) DeleteAt(idx int, length int) + func (h Content) ChrAt(idx int) rune + func (h Content) Length() int + func (h Content) RangeOver(start, end int, attrs gowid.IRenderContext, proc gowid.ICellProcessor) + func (h Content) String() string + func (h Content) Width() int + type ContentCB struct + type ContentSegment struct + Style gowid.ICellStyler + Text string + func StringContent(s string) ContentSegment + func StyledContent(text string, style gowid.ICellStyler) ContentSegment + type ContentToCellArray struct + Cells []gowid.Cell + Cur int + func (m *ContentToCellArray) ProcessCell(cell gowid.Cell) gowid.Cell + type CopyableWidget struct + func NewCopyable(text string, id gowid.IIdentity, cs gowid.IClipboardSelected, opts ...Options) *CopyableWidget + func (w *CopyableWidget) Clips(app gowid.IApp) []gowid.ICopyResult + func (w *CopyableWidget) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas + func (w *CopyableWidget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool + type IChrAt interface + ChrAt func(i int) rune + type ICloneContent interface + Clone func() IContent + type IContent interface + AddAt func(idx int, content ContentSegment) + ChrAt func(idx int) rune + DeleteAt func(idx, length int) + Length func() int + RangeOver func(start, end int, attrs gowid.IRenderContext, proc gowid.ICellProcessor) + Width func() int + type ICursor interface + CursorEnabled func() bool + CursorPos func() int + SetCursorDisabled func() + SetCursorPos func(pos int, app gowid.IApp) + type ISimple interface + SetText func(text string, app gowid.IApp) + Text func() string + type IWidget interface + Align func() gowid.IHAlignment + ClipIndicator func() string + Content func() IContent + LinesFromTop func() int + Wrap func() WrapType + type LineLayout struct + Clipped bool + EndLength int + EndWidth int + StartLength int + StartWidth int + type Options struct + Align gowid.IHAlignment + ClipIndicator string + Wrap WrapType + type SimpleCursor struct + Pos int + func (c *SimpleCursor) CursorEnabled() bool + func (c *SimpleCursor) CursorPos() int + func (c *SimpleCursor) SetCursorDisabled() + func (c *SimpleCursor) SetCursorPos(pos int, app gowid.IApp) + type StyledRune struct + Attr gowid.ICellStyler + Chr rune + func MakeAttributedRunes(m ContentSegment) []StyledRune + type TextLayout struct + Lines []LineLayout + func MakeTextLayout(content IContent, width int, wrap WrapType, align gowid.IHAlignment) *TextLayout + type Widget struct + Callbacks *gowid.Callbacks + func New(text string, opts ...Options) *Widget + func NewFromContent(content IContent) *Widget + func NewFromContentExt(content IContent, opts Options) *Widget + func (w *Widget) Align() gowid.IHAlignment + func (w *Widget) ClipIndicator() string + func (w *Widget) Content() IContent + func (w *Widget) LinesFromTop() int + func (w *Widget) OnContentSet(cb gowid.IWidgetChangedCallback) + func (w *Widget) Read(p []byte) (n int, err error) + func (w *Widget) RemoveOnContentSet(cb 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(align gowid.IHAlignment, app gowid.IApp) + func (w *Widget) SetContent(app gowid.IApp, content IContent) + func (w *Widget) SetLinesFromTop(l int, app gowid.IApp) + func (w *Widget) SetText(text string, app gowid.IApp) + func (w *Widget) SetWrap(wrap WrapType, app gowid.IApp) + func (w *Widget) String() string + func (w *Widget) Wrap() WrapType + type Widget1 struct + I int + func (w *Widget1) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas + func (w *Widget1) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox + func (w *Widget1) Selectable() bool + func (w *Widget1) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool + type WidgetWithCursor struct + func (w *WidgetWithCursor) CalculateTopMiddleBottom(size gowid.IRenderSize) (int, int, int) + func (w *WidgetWithCursor) Render(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.ICanvas + type WrapType int + const WrapAny + const WrapClip + type Writer struct + func (w *Writer) Write(p []byte) (n int, err error)