MCPcopy Create free account
hub / github.com/SolarLune/masterplan / NewButtonGroup

Function NewButtonGroup

gui.go:1173–1194  ·  view source on GitHub ↗
(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, choices ...string)

Source from the content-addressed store, hash-verified

1171}
1172
1173func NewButtonGroup(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, choices ...string) *ButtonGroup {
1174
1175 if rect == nil {
1176 rect = &sdl.FRect{0, 0, 1, 1}
1177 }
1178
1179 group := &ButtonGroup{
1180 Rect: rect,
1181 Options: []string{},
1182 Buttons: []*Button{},
1183 Property: property,
1184 WorldSpace: worldSpace,
1185 MaxButtonsPerRow: 1,
1186 Labels: []*Label{},
1187 OnChoose: onChoose,
1188 }
1189
1190 group.SetChoices(choices...)
1191
1192 return group
1193
1194}
1195
1196func (bg *ButtonGroup) SetLabels(headers ...string) {
1197 for _, header := range headers {

Callers 1

ConstructMenusFunction · 0.85

Calls 1

SetChoicesMethod · 0.95

Tested by

no test coverage detected