Documentation
¶
Index ¶
- type BaseWidget
- func (w *BaseWidget) Bounds() core.Rect
- func (w *BaseWidget) IsDirty() bool
- func (w *BaseWidget) IsFocused() bool
- func (w *BaseWidget) IsVisible() bool
- func (w *BaseWidget) MarkClean()
- func (w *BaseWidget) MarkDirty()
- func (w *BaseWidget) MinSize() core.Point
- func (w *BaseWidget) SelfDirty() bool
- func (w *BaseWidget) SetBounds(r core.Rect)
- func (w *BaseWidget) SetFocused(focused bool)
- func (w *BaseWidget) SetMinSize(size core.Point)
- func (w *BaseWidget) SetVisible(visible bool)
- type TextAlign
- type Widget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseWidget ¶
type BaseWidget struct {
// contains filtered or unexported fields
}
BaseWidget provides common functionality for widgets.
func (*BaseWidget) Bounds ¶
func (w *BaseWidget) Bounds() core.Rect
Bounds returns the widget's bounds.
func (*BaseWidget) IsDirty ¶
func (w *BaseWidget) IsDirty() bool
IsDirty returns true if the widget needs to be redrawn.
func (*BaseWidget) IsFocused ¶
func (w *BaseWidget) IsFocused() bool
IsFocused returns true if the widget has focus.
func (*BaseWidget) IsVisible ¶
func (w *BaseWidget) IsVisible() bool
IsVisible returns true if the widget is visible.
func (*BaseWidget) MarkClean ¶
func (w *BaseWidget) MarkClean()
MarkClean marks the widget as not needing a redraw.
func (*BaseWidget) MarkDirty ¶
func (w *BaseWidget) MarkDirty()
MarkDirty marks the widget as needing a redraw.
func (*BaseWidget) MinSize ¶
func (w *BaseWidget) MinSize() core.Point
MinSize returns the minimum size the widget needs.
func (*BaseWidget) SelfDirty ¶
func (w *BaseWidget) SelfDirty() bool
SelfDirty returns true if the widget itself needs a redraw. Containers can use this to distinguish their own dirty state from children.
func (*BaseWidget) SetBounds ¶
func (w *BaseWidget) SetBounds(r core.Rect)
SetBounds sets the widget's bounds.
func (*BaseWidget) SetFocused ¶
func (w *BaseWidget) SetFocused(focused bool)
SetFocused sets the focus state of the widget.
func (*BaseWidget) SetMinSize ¶
func (w *BaseWidget) SetMinSize(size core.Point)
SetMinSize sets the minimum size for the widget.
func (*BaseWidget) SetVisible ¶
func (w *BaseWidget) SetVisible(visible bool)
SetVisible sets the visibility of the widget.
type Widget ¶
type Widget interface {
Draw(buf *core.Buffer)
Bounds() core.Rect
SetBounds(r core.Rect)
MinSize() core.Point
HandleEvent(ev input.Event) bool
SetFocused(focused bool)
IsFocused() bool
IsDirty() bool
MarkClean()
SetVisible(visible bool)
IsVisible() bool
}
Widget is the interface that all widgets must implement.