Fyne API "widget.CheckGroup"


import "fyne.io/fyne/v2/widget"


type CheckGroup

type CheckGroup struct {
	Horizontal bool
	Required   bool
	OnChanged  func([]string) `json:"-"`
	Options    []string
	Selected   []string

CheckGroup widget has a list of text labels and checkbox icons next to each. Changing the selection (any number can be selected) will trigger the changed func.

Since: 2.1

func NewCheckGroup

func NewCheckGroup(options []string, changed func([]string)) *CheckGroup

NewCheckGroup creates a new check group widget with the set options and change handler

Since: 2.1

func (*CheckGroup) Append

func (r *CheckGroup) Append(option string)

Append adds a new option to the end of a CheckGroup widget.

func (*CheckGroup) CreateRenderer

func (r *CheckGroup) CreateRenderer() fyne.WidgetRenderer

CreateRenderer is a private method to Fyne which links this widget to its renderer

func (*CheckGroup) MinSize

func (r *CheckGroup) MinSize() fyne.Size

MinSize returns the size that this widget should not shrink below

func (*CheckGroup) Refresh

func (r *CheckGroup) Refresh()

Refresh causes this widget to be redrawn in it’s current state.

Implements: fyne.CanvasObject

func (*CheckGroup) Remove

func (r *CheckGroup) Remove(option string) bool

Remove removes the first occurrence of the specified option found from a CheckGroup widget. Return true if an option was removed.

Since: 2.3

func (*CheckGroup) SetSelected

func (r *CheckGroup) SetSelected(options []string)

SetSelected sets the checked options, it can be used to set a default option.