Documentation
¶
Index ¶
- type Element
- func (e *Element) AddChild(child *Element)
- func (e *Element) Attr(name, def string) string
- func (e *Element) AttrBool(name string, def bool) bool
- func (e *Element) AttrColor(name string, def graphics.Color) graphics.Color
- func (e *Element) AttrFloat(name string, def float64) float64
- func (e *Element) AttrInt(name string, def int) int
- func (e *Element) BindSignal(name string, fn interface{}) bool
- func (e *Element) Bounds() graphics.Rect
- func (e *Element) ChildElements() []*Element
- func (e *Element) Children() []gapp.Widget
- func (e *Element) ClearChildren()
- func (e *Element) DirtyRects() []graphics.Rect
- func (e *Element) Draw(buf *graphics.Buffer)
- func (e *Element) EmitSignal(name string, args ...interface{})
- func (e *Element) FindChild(id string) *Element
- func (e *Element) GetAttribute(name string) string
- func (e *Element) HandleEvent(ev graphics.Event) bool
- func (e *Element) HasAttribute(name string) bool
- func (e *Element) ID() string
- func (e *Element) IsDirty() bool
- func (e *Element) IsFocused() bool
- func (e *Element) IsVisible() bool
- func (e *Element) MarkClean()
- func (e *Element) MarkDirty()
- func (e *Element) MinSize() graphics.Point
- func (e *Element) ScrollTextAreaToBottom()
- func (e *Element) SelfDirty() bool
- func (e *Element) SetAttribute(name string, value interface{})
- func (e *Element) SetBounds(r graphics.Rect)
- func (e *Element) SetFocused(focused bool)
- func (e *Element) SetID(id string)
- func (e *Element) SetTerminalBuffer(lines [][]TerminalCell, cursorCol, cursorRow int, showCursor bool)
- func (e *Element) SetVisible(visible bool)
- func (e *Element) Tag() string
- func (e *Element) TextAreaAtBottom(threshold int) bool
- type TerminalCell
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element is the universal DOM-like node. Every UI element is an Element. It implements widget.Widget and renders entirely from attributes. Based on its attributes, it can behave as any widget: button, text input, checkbox, slider, container, etc.
func BuildMenuPopup ¶
BuildMenuPopup clones a menu subtree and returns popup content plus dimensions.
func NewElement ¶
NewElement creates a new Element with the given tag.
func (*Element) BindSignal ¶
BindSignal binds a runtime signal handler (for example "clicked").
func (*Element) ChildElements ¶
ChildElements returns child elements.
func (*Element) ClearChildren ¶
func (e *Element) ClearChildren()
ClearChildren removes all child elements.
func (*Element) DirtyRects ¶
DirtyRects returns optional subregions that should be redrawn for this widget. Nil means repaint the full widget bounds.
func (*Element) EmitSignal ¶
EmitSignal emits a signal by name with optional args.
func (*Element) GetAttribute ¶
GetAttribute returns an attribute value.
func (*Element) HasAttribute ¶
HasAttribute reports whether the attribute key exists.
func (*Element) ScrollTextAreaToBottom ¶
func (e *Element) ScrollTextAreaToBottom()
ScrollTextAreaToBottom moves the multiline viewport to the newest lines.
func (*Element) SetAttribute ¶
SetAttribute sets an attribute value and marks dirty.
func (*Element) SetFocused ¶
func (*Element) SetTerminalBuffer ¶
func (e *Element) SetTerminalBuffer(lines [][]TerminalCell, cursorCol, cursorRow int, showCursor bool)
SetTerminalBuffer updates a multiline element with terminal-styled cells. It keeps the text-area scroll state while replacing its backing lines.
func (*Element) SetVisible ¶
func (*Element) TextAreaAtBottom ¶
TextAreaAtBottom reports whether the current multiline viewport is at the end.