类型 LabelPainter

API 文档由 Go 源码生成,内容为英文。

type LabelPainter struct {
	// contains filtered or unexported fields
}

LabelPainter is a compact field-label declaration.

构造函数

BeginLabel#

func BeginLabel(canvas *ui.Canvas, theme ui.Theme, bounds ui.Rect) LabelPainter

BeginLabel starts a label declaration.

方法

Disabled#

func (label LabelPainter) Disabled() LabelPainter

Disabled uses the muted label treatment.

For#

func (label LabelPainter) For(control ui.ID) LabelPainter

For makes the label the label of a control, as `htmlFor` does: pressing the text focuses and clicks the control (see ui.Canvas.HitLabel), and the text names it for assistive technology. A disabled label does nothing.

Paint#

func (label LabelPainter) Paint(text string)

Paint draws the label text and optional required marker.

Required#

func (label LabelPainter) Required() LabelPainter

Required appends a semantic danger-colored required marker.