MCPcopy
hub / github.com/g3n/engine / buildRadioButton

Function buildRadioButton

gui/builder_panel.go:245–268  ·  view source on GitHub ↗

buildRadioButton builds a gui object of type: RadioButton

(b *Builder, am map[string]interface{})

Source from the content-addressed store, hash-verified

243
244// buildRadioButton builds a gui object of type: RadioButton
245func buildRadioButton(b *Builder, am map[string]interface{}) (IPanel, error) {
246
247 // Builds check box and set commont attributes
248 var text string
249 if am[AttribText] != nil {
250 text = am[AttribText].(string)
251 }
252 rb := NewRadioButton(text)
253 err := b.SetAttribs(am, rb)
254 if err != nil {
255 return nil, err
256 }
257
258 // Sets optional radio button group
259 if gr := am[AttribGroup]; gr != nil {
260 rb.SetGroup(gr.(string))
261 }
262
263 // Sets optional checked value
264 if checked := am[AttribChecked]; checked != nil {
265 rb.SetValue(checked.(bool))
266 }
267 return rb, nil
268}
269
270// buildVList builds a gui object of type: VList
271func buildVList(b *Builder, am map[string]interface{}) (IPanel, error) {

Callers

nothing calls this directly

Calls 4

NewRadioButtonFunction · 0.85
SetAttribsMethod · 0.80
SetGroupMethod · 0.80
SetValueMethod · 0.45

Tested by

no test coverage detected