类型 ToggleResult

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

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

ToggleResult is what painting a toggle reports back. Clicked is true in the event pass of a click on it (see ui.Canvas.Clicked), so the code that declares a toggle is the code that flips it:

if components.BeginToggle(canvas, theme, bold, bounds, m.bold).Default("B").Clicked() {
	m.bold = !m.bold
}

方法

Clicked#

func (result ToggleResult) Clicked() bool

Clicked reports whether this paint is delivering a click on the toggle.