Type Select

type Select struct {

	// rows lays the popup's rows out, scrolled when the options have a Scroll.

}

Select paints a typed native select trigger and, when open, its source-owned popup. Value ownership and popup placement remain application state.

Constructors

BeginSelect#

func BeginSelect(canvas *ui.Canvas, theme ui.Theme, triggerBounds ui.Rect, options SelectOptions) Select

BeginSelect paints the trigger and optional open popup.

Methods

AddItem#

func (selectControl *Select) AddItem(item SelectItem) ui.Rect

AddItem paints one option with selected and disabled semantics. The rectangle is empty when the row is scrolled out of the popup.

AddLabel#

func (selectControl *Select) AddLabel(label string) ui.Rect

AddLabel paints one muted group label in the open popup.

AddScrollDown#

func (selectControl *Select) AddScrollDown(id ui.ID, disabled bool) ui.Rect

AddScrollDown paints the explicit scroll-down action used by bounded popups.

AddScrollUp#

func (selectControl *Select) AddScrollUp(id ui.ID, disabled bool) ui.Rect

AddScrollUp paints the explicit scroll-up action used by bounded popups.

AddSeparator#

func (selectControl *Select) AddSeparator() ui.Rect

AddSeparator paints a group divider.

ContentBounds#

func (selectControl Select) ContentBounds() ui.Rect

ContentBounds returns the normalized popup geometry, or zero when closed.

End#

func (selectControl Select) End()

End paints the scrollbar of a popup whose items did not all fit, and ends the popup's entrance and exit: call it once the last item is painted, or the popup appears and disappears at once. A closed select needs no End, and is not harmed by one.

NextItemBounds#

func (selectControl Select) NextItemBounds() ui.Rect

NextItemBounds reports the next keyboard-navigation row.

TriggerBounds#

func (selectControl Select) TriggerBounds() ui.Rect

TriggerBounds returns the normalized trigger geometry.