(rect *sdl.FRect, worldSpace bool, onChoose func(index int), property *Property, choices ...string)
| 1171 | } |
| 1172 | |
| 1173 | func 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 | |
| 1196 | func (bg *ButtonGroup) SetLabels(headers ...string) { |
| 1197 | for _, header := range headers { |
no test coverage detected