Documentation
¶
Overview ¶
Package elided renders text that says when it has been cut short.
A packet list column that is too narrow simply stops drawing, so 192.0.2.10 in an eighty-column terminal appears as 192.0.2.1 - a different address, equally valid, with nothing to say a digit is missing. Somebody reading that writes down the wrong host. Every value in the list can be cut this way; addresses are only where it does the most damage.
Index ¶
- Constants
- func Clip(s string, width int) string
- type Widget
- 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) Selectable() bool
- func (w *Widget) Text() string
- func (w *Widget) UserInput(ev interface{}, size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) bool
Constants ¶
View Source
const Marker = '…'
Marker ends a value that did not fit. One cell wide, and distinct from anything that appears in an address, a protocol name or a length.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Widget ¶
type Widget struct {
// contains filtered or unexported fields
}
Widget is a text widget that clips to the width it is given, when it is given only one row to draw in.
func (*Widget) RenderSize ¶
func (w *Widget) RenderSize(size gowid.IRenderSize, focus gowid.Selector, app gowid.IApp) gowid.IRenderBox
func (*Widget) Selectable ¶
Click to show internal directories.
Click to hide internal directories.