类型 SegmentedControlResult

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

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

SegmentedControlResult is what painting a segmented control reports back.

方法

Clicked#

func (result SegmentedControlResult) Clicked() (ui.ID, bool)

Clicked returns the option whose click this paint is delivering, and false in every other paint (see ui.Canvas.Clicked), so the code that declares the control is the code that changes the selection:

if id, ok := components.BeginSegmentedControl(canvas, theme, bounds, options, selected).Paint().Clicked(); ok {
	selected = id
}